Overview
Add automated benchmark CI workflow to detect performance regressions. This will improve the Rust Tooling & CI/CD score (currently 45.5/130, 35%).
Current State
Benchmarks exist:
benches/linear_regression.rs
benches/kmeans.rs
benches/dataframe.rs
No CI automation - benchmarks only run manually via cargo bench
Proposed Solution
Create .github/workflows/benchmark.yml with:
- On-demand benchmarking (workflow_dispatch)
- PR benchmarking (optional, compare against main)
- Results storage as artifacts
- Optional: Performance regression alerts (if > 10% slower)
Implementation
Basic workflow:
name: Benchmarks
on:
workflow_dispatch: # Manual trigger
pull_request:
paths:
- 'src/**'
- 'benches/**'
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run benchmarks
run: cargo bench
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: target/criterion/
Benefits
- Early detection of performance regressions
- Historical tracking of performance over time
- CI/CD score improvement (pmat rust-project-score)
- Confidence in merging performance-sensitive changes
Acceptance Criteria
References
Overview
Add automated benchmark CI workflow to detect performance regressions. This will improve the Rust Tooling & CI/CD score (currently 45.5/130, 35%).
Current State
Benchmarks exist:
benches/linear_regression.rsbenches/kmeans.rsbenches/dataframe.rsNo CI automation - benchmarks only run manually via
cargo benchProposed Solution
Create
.github/workflows/benchmark.ymlwith:Implementation
Basic workflow:
Benefits
Acceptance Criteria
.github/workflows/benchmark.ymlcreatedReferences