Skip to content

ci(codspeed): add backend CPU benchmarks for uploads and product trees - #475

Merged
simonvanlierde merged 2 commits into
mainfrom
ci/codspeed-benchmarks
Oct 26, 2026
Merged

simonvanlierde merged 2 commits into
mainfrom
ci/codspeed-benchmarks

Conversation

@simonvanlierde

Copy link
Copy Markdown
Contributor

Adds CodSpeed benchmarks for the backend code that runs on every upload and every product tree request, measured in CodSpeed's CPU simulation mode. Replaces #462: that one benchmarked the export by validating plain dicts, which the route never does, and its 1280 px test image skipped the JPEG draft step that thumbnail speed depends on.

  • Image uploads: metadata stripping with rotation and the thumbnail set, on a 12 MP phone JPEG. Each round gets a fresh copy of the upload, made outside the measurement.
  • Product trees: create-request validation, the component tree read at its 1,000-component cap, and the export's read models, JSON and CSV, each through the same functions as its route. Rows are built in memory, so no database is needed.
  • Workflow: runs on main and on pull requests that touch the backend, and uploads with OIDC. Only the benchmark job gets id-token: write. CI's test run leaves the benchmarks out.

Tests: just backend/bench (7 passed) and just backend/check. The simulation mode only runs on CodSpeed's runner, so this PR is its first real run.

- Image uploads: metadata stripping with rotation, and the thumbnail set, on a 12 MP
  phone JPEG so thumbnails take the JPEG draft path
- Product trees: create-request validation, the component tree read at its
  1,000-component cap, and the export's read models, JSON and CSV, all from rows
  built in memory
- pytest-codspeed in the tests group and a `just bench` recipe that runs them once
Runs in CodSpeed's CPU simulation mode on pushes to main and on pull requests
that touch the backend, uploading with OIDC from a job that holds the only
id-token permission in the workflow.
@codspeed

codspeed Bot commented Oct 26, 2026

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 7 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@simonvanlierde
simonvanlierde merged commit ac9fb48 into main Oct 26, 2026
25 checks passed
@simonvanlierde
simonvanlierde deleted the ci/codspeed-benchmarks branch October 26, 2026 15:01
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