Repository navigation
Run benchmarks with CodSpeed in CI - #1
Open
codspeed[bot] wants to merge 1 commit into
Open
codspeed[bot] wants to merge 1 commit into
codspeed[bot] wants to merge 1 commit into
Conversation
…d CI Port the nightly libtest #[bench] benchmarks to the bencher API through codspeed-bencher-compat, so they build on stable Rust and CodSpeed can measure them. Add a CodSpeed workflow that runs them in simulation mode on pushes to master and on pull requests, and a CodSpeed badge in the README.
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch. 2 warnings
|
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 sets up CodSpeed so every pull request gets a performance report that compares its benchmarks with
master.What changed
Existing benchmarks, now on stable Rust. The benchmarks in
benches/andndarray-rand/benches/used nightly-only libtest#[bench]. They now use thebencherAPI throughcodspeed-bencher-compat(a dev-dependency renamed tobencher). The benchmark bodies are unchanged. The port is mechanical:#![feature(test)]/extern crate testremoved;test::black_boxreplaced bystd::hint::black_box.#[bench]attributes replaced by abenchmark_group!/benchmark_main!at the end of each file, and[[bench]] harness = falseentries inCargo.toml.par_rayonusesrequired-features = ["rayon"]instead of a crate-level#![cfg(feature = "rayon")].mat_mul!benchmarks are registered with their module path (mat_mul_f32::m004, ...), so the f32, f64 and i32 variants keep distinct names.Outside of CodSpeed,
cargo benchstill works and uses the plainbenchercrate, now on any toolchain.CI. A new
.github/workflows/codspeed.yamlbuilds and runs the benchmarks in CodSpeed's CPU simulation mode on pushes tomaster, on pull requests, and on manual dispatch. It authenticates with OIDC, so no secret token is needed.README. A CodSpeed badge, and a short "Benchmarks" section with the local command:
Results
The CodSpeed workflow passed on this pull request, and the CodSpeed report lists 229 new benchmarks (232 run, see below for the 3 others). A local run gave the same set: run report.
Notes:
bench1.rs::into_dimensionality_ix1_ok,into_dimensionality_ix3_okandinto_dimensionality_ix3_errmeasure under 1 ns: the compiler removes the code under test. This port does not change their code. Wrapping their inputs and outputs inblack_boxwould fix it.par_rayon.rsbenchmarks are flagged as dominated by system calls (thread synchronization). Simulation excludes system calls, so these numbers understate the real multi-threaded cost. Walltime would measure them better, but walltime needs CodSpeed macro runners, which are not available on personal accounts. Onubuntu-latest, walltime results vary much more than on macro runners.Existing CI failures
The "Continuous integration" workflow fails on this pull request, but the same jobs already fail on
masterand the errors are not in the benchmark code:tests/*,cross_test/*andcargo-carefulstop ontests/numeric.rs, which uses the deprecatedstd::f64::NANwhileRUSTFLAGShas-D warnings.clippy/stablestops on new clippy lints insrc/and a removed lint name.Comment this and I'll do it: