Skip to content

ci: Add CodSpeed benchmarking support#1940

Open
AdilZouitine wants to merge 1 commit into
mainfrom
feat/add-codspeed
Open

ci: Add CodSpeed benchmarking support#1940
AdilZouitine wants to merge 1 commit into
mainfrom
feat/add-codspeed

Conversation

@AdilZouitine

@AdilZouitine AdilZouitine commented Jul 4, 2026

Copy link
Copy Markdown
Member

What & Why

Add CodSpeed so PRs can catch performance regressions before merge. This gives River a fast benchmark signal for Python and Rust paths, while keeping the existing asv suite.

How

  • Add the CodSpeed GitHub Actions workflow.
  • Add Python CodSpeed benchmarks for linear models and stats.
  • Add local benchmark commands and docs.
  • Fix the Rust benchmark wiring so criterion benches use the uv Python env.

Testing

  • uv run prek run --all-files
  • make benchmark
  • make benchmark-rust

Notes for reviewers

The main things to check are the CI workflow triggers, benchmark size, and whether the Rust benchmark env setup is clear enough for contributors.

AI Usage

I used AI to find the corner cases.

- Updated `Cargo.lock` to include new dependencies: `anyhow`, `approx`, `bitflags`, `cc`, `cfg_aliases`, `colored`, `find-msvc-tools`, `getrandom`, `glob`, `nix`, `r-efi`, and `statrs`.
- Replaced `criterion` with `codspeed-criterion-compat` in `Cargo.toml` for benchmarking.
- Added CodSpeed benchmarking setup in GitHub Actions with workflows for both Python and Rust benchmarks.
- Introduced new benchmark tests for linear models and statistics in `benchmarks/codspeed`.
- Updated documentation to include instructions for running benchmarks locally and integrating with CodSpeed.
@AdilZouitine AdilZouitine added Testing Performance dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code rust Pull requests that update rust code labels Jul 4, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 4, 2026

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 16 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

@AdilZouitine AdilZouitine self-assigned this Jul 4, 2026
@AdilZouitine AdilZouitine changed the title Add CodSpeed benchmarking support ci: Add CodSpeed benchmarking support Jul 4, 2026
@AdilZouitine AdilZouitine marked this pull request as ready for review July 4, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Performance python:uv Pull requests that update python:uv code rust Pull requests that update rust code Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant