Repository navigation
Add CodSpeed continuous benchmarking - #8613
Merged
Merged
Conversation
Alias criterion to codspeed-criterion-compat so the existing benchmark suites can be measured by CodSpeed with CPU simulation on every pull request, and add the workflow running them.
1 task done
Contributor
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Member
|
Thank you so much! |
youknowone
pushed a commit
that referenced
this pull request
Sep 16, 2026
Alias criterion to codspeed-criterion-compat so the existing benchmark suites can be measured by CodSpeed with CPU simulation on every pull request, and add the workflow running them. Co-authored-by: CodSpeed Bot <[email protected]>
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.
This wires the existing benchmark suites into CodSpeed so that every pull request gets a performance report, measured with CPU simulation instead of wall time.
Changes
Cargo.toml: the workspacecriteriondependency is now thecodspeed-criterion-compatdrop-in (package = "codspeed-criterion-compat"). The compatibility layer only takes over when the CodSpeed runner drives the benchmarks, socargo benchandcargo criterionkeep behaving as before, and no benchmark had to be rewritten. This covers the three existing suites:benches/execution.rs,benches/microbenchmarks.rsandcrates/sre_engine/benches/benches.rs.benches/execution.rs,benches/microbenchmarks.rs: two adjustments that only apply whenCODSPEED_ENVis set (i.e. under the CodSpeed runner):ITERATIONSrun with a single size instead of five. The criterion benchmark id does not include the iteration count, so all five sizes are reported under the same name and only the last one would be kept..github/workflows/codspeed.yaml: new workflow building the benchmark targets withcargo codspeedand running them throughCodSpeedHQ/actioninsimulationmode. Actions are hash-pinned, permissions are granted at the job level, and the cargo/target cache is only saved onmain, following the conventions of the existing workflows.README.md/benches/README.md: CodSpeed badge and a short section documenting how to reproduce a CodSpeed run locally.Verification
The full suite was built and executed locally with the CodSpeed CLI:
36 benchmarks are reported (parsing, whole-file execution, pystone, microbenchmarks and the SRE engine patterns) and the instrumented run takes about 95 seconds, so the job is dominated by the build, not by the measurement.
cargo check --benchesandcargo fmt --checkpass, and the new workflow is clean foractionlintandzizmorwith the repository configuration.Notes and possible follow-ups
libpythonthrough thepyo3dev-dependency, hence theactions/setup-pythonstep in the workflow.pystone.pyandfannkuch.pyonly measure compilation: their bodies are guarded byif __name__ == '__main__', which is false when the code object is executed in a fresh scope. That is pre-existing behaviour and was left untouched here, but it also means theLOOPSparameter of the pystone group currently has no effect.mainbranch as the performance baseline. The first pull requests after the merge will show a comparison as soon as amainrun has been recorded.