Skip to content

Profile benchmarks with pyinstrument and benchmark the full zip listing - #1660

Closed
danlamanna wants to merge 3 commits into
masterfrom
benchmark-zip-listing-profiles
Closed

danlamanna wants to merge 3 commits into
masterfrom
benchmark-zip-listing-profiles

Conversation

@danlamanna

@danlamanna danlamanna commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Benchmark harness changes from profiling the zip download file listing, separate from the listing fix itself.

  • The zip download benchmarks now include an everything_as_staff search. They only ran as an anonymous user before, so the largest listing they measured was the public subset (46K of the 100K images). The whole-archive download, which only staff can request, is the one that scales worst.
  • --profile-dir=DIR writes a pyinstrument profile (html and text) of one call of each benchmarked function, taken before the timed rounds. The profile dependency group is installed in the benchmark env for it.
  • BENCHMARK_EXTRA_IMAGES=N adds N images on top of the fixed dataset, with the fixed dataset's mix of cohorts, patients, lesions and metadata, in cohorts of their own, kept in a template database of their own.

Example:

BENCHMARK_EXTRA_IMAGES=1000000 uv run tox -e benchmark -- -k "zip_download and file-listing" --profile-dir=.benchmarks/profiles

Because dataset.py changed, the next benchmark run (including CI) generates a new template database for the base dataset.

The zip download benchmarks only ran as an anonymous user, so the largest
listing they measured was the public subset. The whole-archive download,
which only staff can request, is the one that scales worst.
…ment

The profile is of one call of the benchmarked function, taken before the
timed rounds, and written as html and text named after the test.
Setting it adds that many TBP tiles on top of the fixed dataset, in a few
huge cohorts like production, and keeps them in their own template
database. With 1,000,000 tiles the dataset takes about 13 minutes to
generate and 3.4 GB.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@danlamanna danlamanna closed this Nov 20, 2026
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