Repository navigation
ci(codspeed): add backend CPU benchmarks measured with CodSpeed - #462
Closed
codspeed[bot] wants to merge 1 commit into
Closed
codspeed[bot] wants to merge 1 commit into
codspeed[bot] wants to merge 1 commit into
Conversation
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Contributor
|
Thanks for the setup. Replaced by #475, which keeps the workflow and reworks the benchmarks to use realistic inputs and the same code paths as the routes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds continuous performance tracking for the backend with CodSpeed. Benchmarks are written with
pytest-codspeedand measured in CodSpeed's CPU simulation mode, which keeps results stable on GitHub-hosted runners.What's included
Benchmarks (
backend/tests/benchmarks/): no database, Docker or network neededtest_process_image_for_storagetest_filter_exiftest_generate_thumbnailstest_validate_product_create_treeProductCreateWithComponentswith 84 nested componentstest_validate_product_export_treesProductExportReadtrees, including the image and thumbnail URL derivationtest_dump_product_export_jsontest_render_products_csvtest_keyed_digestkeyed_digestTooling
pytest-codspeedadded to the backendtestsdependency group (uv.lockupdated)just backend/benchruns the benchmarks once as plain tests.github/workflows/codspeed.ymlworkflow runs on pushes tomain, on pull requests, and onworkflow_dispatch. It reuses thesetup-runtimecomposite action, pins every action to a commit SHA, and authenticates with OIDC (id-token: writeis granted to this job only). It is kept separate fromci.yml, as Scorecard is, so the extra permission doesn't spread to other jobs.backend/README.mdandbackend/tests/README.mdtests/benchmarksisn't injust backend/test-ci, so the existing CI suite is unchanged. The prek hooks (actionlint, zizmor, ruff, rumdl, uv-lock) pass on the changed files.Running locally
Next steps
mainbecomes the baseline, and later PRs get a performance report comment.test_*.pyfile underbackend/tests/benchmarks/that uses thebenchmarkfixture.Comment
@codspeedbot <request>(for example, "add a benchmark for the product tree queries") and I'll do it.