Skip to content

Add benchmark CI workflow for performance regression detection #43

@noahgift

Description

@noahgift

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:

  1. On-demand benchmarking (workflow_dispatch)
  2. PR benchmarking (optional, compare against main)
  3. Results storage as artifacts
  4. 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

  • .github/workflows/benchmark.yml created
  • Workflow runs successfully on manual trigger
  • Benchmark results stored as artifacts
  • All 3 benchmarks execute (linear_regression, kmeans, dataframe)
  • Documentation updated in CLAUDE.md

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions