From e8aa409ced5b0d1f4a9f38f8d2d8470a6d79b47e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 27 Nov 2021 09:48:45 +0100 Subject: [PATCH] parse_repo: iterate over tar object this is ~20% faster compared to calling getmembers() --- app/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/fetch.py b/app/fetch.py index d18fd4a..d3775f0 100644 --- a/app/fetch.py +++ b/app/fetch.py @@ -134,7 +134,7 @@ async def parse_repo(repo: str, repo_variant: str, files_url: str, download_url: with io.BytesIO(data) as f: with ExtTarFile.open(fileobj=f, mode="r") as tar: packages: Dict[str, list] = {} - for info in tar.getmembers(): + for info in tar: package_name = info.name.split("/", 1)[0] infofile = tar.extractfile(info) if infofile is None: