Skip to content

Cache duplicate query_object calls#388

Open
hugovk wants to merge 1 commit intopython:mainfrom
hugovk:cache-query_object
Open

Cache duplicate query_object calls#388
hugovk wants to merge 1 commit intopython:mainfrom
hugovk:cache-query_object

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented May 10, 2026

Small performance improvement.

query_object is called once per release file:

    for rfile, file_desc, os_slug, add_download, add_desc in release_files:
        if not os_slug:
            continue
        os_pk = query_object(args.base_url, "os", slug=os_slug)

There might be 12 release files but four slugs:

File Slug
1 Python-3.14.5.tgz source
2 Python-3.14.5.tar.xz source
3 windows-3.14.5.json windows
4 python-3.14.5-embed-amd64.zip windows
5 python-3.14.5-embed-arm64.zip windows
6 python-3.14.5-embed-win32.zip windows
7 python-3.14.5-amd64.exe windows
8 python-3.14.5-arm64.exe windows
9 python-3.14.5.exe windows
10 python-3.14.5-macos11.pkg macos
11 python-3.14.5-aarch64-linux-android.tar.gz android
12 python-3.14.5-x86_64-linux-android.tar.gz android

So we only need to call the API four times, not 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant