Add CodSpeed continuous performance measurement#1942
Draft
codspeed-hq[bot] wants to merge 1 commit into
Draft
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.
|
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 sets up CodSpeed for continuous performance measurement of River's Rust core (the
statsmodule inrust_src, exposed to Python via PyO3).River already ships a set of criterion benchmarks in
benches/stats_bench.rscovering the streaming statistics primitives (mean, variance, EW mean/variance, kurtosis, skew, quantile, rolling quantile, rolling IQR). This change wires those benchmarks into CodSpeed so performance is tracked automatically on every pull request and on pushes tomain.Changes
Cargo.toml: Swapped thecriteriondev-dependency forcodspeed-criterion-compat(aliased ascriterion, version 5.0.1). The compat layer is a drop-in replacement, sobenches/stats_bench.rsis unchanged. Also declared thestats_benchbench target withharness = falseso it is picked up bycargo codspeed.Cargo.lock: Updated to reflect the new dependency..github/workflows/codspeed.yml: New workflow that builds and runs the benchmarks under CodSpeed. It uses OIDC authentication (no token secret required) and runs all three requested instruments via a matrix:instrumentation) onubuntu-latest— deterministic, low-variance CPU measurements with flamegraphs.memory) onubuntu-latest— heap allocation and peak-memory tracking.walltime) oncodspeed-macrorunners — real-world elapsed time on consistent bare-metal hardware.README.md: Added the CodSpeed badge alongside the existing status badges.Verification
The setup was validated locally with the CodSpeed CLI:
cargo codspeed buildandcodspeed run --mode instrumentation -- cargo codspeed runcompleted successfully and reported all 13 benchmarks.cargo codspeed build -m memoryandcargo codspeed build -m walltimeboth compile cleanly. Their runtime measurement could not be exercised in the local sandbox (memory needs an eBPF/BTF-capable kernel and walltime needsperf), but both run on CodSpeed's CI runners.Next steps
main.