Skip to content

ci: Add CodSpeed benchmarks for more modules#1941

Open
AdilZouitine wants to merge 3 commits into
feat/add-codspeedfrom
benchmarks/coder-every-module-with-codspeed-benchmark
Open

ci: Add CodSpeed benchmarks for more modules#1941
AdilZouitine wants to merge 3 commits into
feat/add-codspeedfrom
benchmarks/coder-every-module-with-codspeed-benchmark

Conversation

@AdilZouitine

@AdilZouitine AdilZouitine commented Jul 4, 2026

Copy link
Copy Markdown
Member

What & Why

Stacked on #1940.

Add CodSpeed benchmarks for more River modules so the new CI signal covers more of the library.

How

  • Add Python benchmarks across estimators, metrics, stats, and utilities.
  • Add shared CodSpeed marks and deterministic workloads.
  • Add Rust criterion benches for internal performance paths.
  • Add needed benchmark dependencies.

Testing

  • uv run prek run --all-files

Notes for reviewers

Please check benchmark size and determinism first. The goal is broad coverage without making CI too slow.

AI Usage

I implemented a few tests myself to give the style, and then the agent generated the other.
I reviewed the generated tests too.

- Introduced new benchmark files for `adwin_bench`, `rolling_metrics_bench`, `sorted_window_bench`, `covariance_bench`, and `expected_mutual_info_bench` in the Rust benchmarks directory.
- Updated `Cargo.toml` to include new benchmark configurations.
- Added Python benchmark tests for various algorithms in the CodSpeed benchmarking framework, including tests for active learning, anomaly detection, and ensemble methods.
- Configured per-file ignores for specific benchmarks in `pyproject.toml` to streamline linting.
- Enhanced the `workloads.py` file to support new benchmark scenarios with deterministic data streams.
@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

Merging this PR will create unknown performance changes

🆕 96 new benchmarks
⏩ 16 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation test_adwin_update N/A 10.5 ms N/A
🆕 Simulation test_kswin_update N/A 713.1 ms N/A
🆕 Simulation test_page_hinkley_update N/A 33 ms N/A
🆕 Simulation test_adwin_bagging_learn N/A 309.9 ms N/A
🆕 Simulation test_bagging_learn N/A 204.7 ms N/A
🆕 Simulation test_srp_learn N/A 487.2 ms N/A
🆕 Simulation test_bag_of_words_transform N/A 19.5 ms N/A
🆕 Simulation test_polynomial_extender_transform N/A 1.9 s N/A
🆕 Simulation test_tfidf_transform N/A 53.1 ms N/A
🆕 Simulation test_amf_classifier_learn N/A 77.8 ms N/A
🆕 Simulation test_amf_classifier_predict N/A 14.5 ms N/A
🆕 Simulation test_arf_classifier_learn N/A 248.6 ms N/A
🆕 Simulation test_arf_classifier_predict N/A 25 ms N/A
🆕 Simulation test_arf_regressor_learn N/A 723.4 ms N/A
🆕 Simulation test_hoeffding_adaptive_tree_learn N/A 553.4 ms N/A
🆕 Simulation test_hoeffding_tree_learn N/A 583.8 ms N/A
🆕 Simulation test_hoeffding_tree_predict N/A 10.5 ms N/A
🆕 Simulation test_hoeffding_tree_regressor_learn N/A 250.3 ms N/A
🆕 Simulation test_entropy_sampler_learn N/A 6.8 ms N/A
🆕 Simulation test_half_space_trees_learn N/A 117.3 ms N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing benchmarks/coder-every-module-with-codspeed-benchmark (5d7b497) with feat/add-codspeed (e1f94f2)

Open in CodSpeed

Footnotes

  1. 16 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

- Added new benchmark tests for various algorithms in the CodSpeed framework, including active learning, anomaly detection, and ensemble methods.
- Introduced Rust benchmarks for adaptive windowing, covariance, expected mutual information, and rolling metrics.
- Updated `Cargo.toml` to include new benchmark paths and configurations.
- Revised `CONTRIBUTING.md` to reflect changes in benchmark directory structure.
- Adjusted `pyproject.toml` to ignore specific benchmark files for linting.
- Enhanced `benchmarks/README.md` with instructions for running benchmarks locally and integrating with CodSpeed.
- Added new Python workload functions to support deterministic data streams for benchmarks.
@AdilZouitine AdilZouitine self-assigned this Jul 4, 2026
- Added a new marker for heavy benchmarks in `pyproject.toml` to categorize tests for the heavy CI shard.
- Updated GitHub Actions workflow to implement a matrix strategy for Python benchmarks, splitting them into "heavy" and "rest" shards based on execution time.
- Revised benchmark tests to utilize the new `heavy` marker, ensuring that the most resource-intensive benchmarks are appropriately categorized.
- Improved documentation in `benchmarks/README.md` to explain the new sharding strategy and its impact on CI performance.
@AdilZouitine AdilZouitine changed the title Add CodSpeed benchmarks for more modules ci: Add CodSpeed benchmarks for more modules 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