From f2df3fa48109fc011eb49689137deea310496f7b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 20:52:13 +0000 Subject: [PATCH 1/2] feat(ci): add manual baseline update workflow and update benchmark sizes - Remove automatic baseline updates from benchmark.yml (main branch pushes) - Add new update-baseline.yml workflow for manual baseline updates - Trigger via workflow_dispatch with ref and iterations inputs - Checkout specified git ref (tag/branch/commit) - Run benchmarks and update baseline artifact - Update benchmark sizes from 100,1000,10000 to 1000,10000,100000 - Baseline updates now require explicit manual trigger via GitHub Actions UI --- .github/workflows/benchmark.yml | 10 +--- .github/workflows/update-baseline.yml | 76 +++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/update-baseline.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f5383b9..078275a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,7 +32,7 @@ jobs: run: | # Run benchmarks with multiple sizes and save to JSON ./target/release/bench_throughput \ - --sizes 100,1000,10000 \ + --sizes 1000,10000,100000 \ --iterations 50 \ --format json \ --output benchmark_results.json @@ -86,14 +86,6 @@ jobs: benchmark_results.json comparison.md - - name: Upload as baseline (main branch only) - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v4 - with: - name: benchmark-baseline - path: benchmark_results.json - retention-days: 90 - - name: Fail if significant performance regression if: steps.compare.outputs.comparison_available == 'true' run: | diff --git a/.github/workflows/update-baseline.yml b/.github/workflows/update-baseline.yml new file mode 100644 index 0000000..f13f5bf --- /dev/null +++ b/.github/workflows/update-baseline.yml @@ -0,0 +1,76 @@ +name: Update Benchmark Baseline + +on: + workflow_dispatch: + inputs: + ref: + description: 'Git ref (tag, branch, or commit SHA) to benchmark' + required: true + default: 'main' + type: string + iterations: + description: 'Number of benchmark iterations' + required: false + default: '50' + type: string + +jobs: + update-baseline: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository at specified ref + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + fetch-depth: 0 + + - name: Get commit info + id: commit-info + run: | + echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "date=$(git log -1 --format=%ci)" >> $GITHUB_OUTPUT + echo "message=$(git log -1 --format=%s)" >> $GITHUB_OUTPUT + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + + - name: Build benchmark tool + run: cargo build --release --bin bench_throughput + + - name: Run benchmarks + run: | + echo "Running benchmarks for commit ${{ steps.commit-info.outputs.short_sha }}" + ./target/release/bench_throughput \ + --sizes 1000,10000,100000 \ + --iterations ${{ inputs.iterations }} \ + --format json \ + --output benchmark_results.json + + - name: Add workflow summary + run: | + echo "## Baseline Update Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Reference:** \`${{ inputs.ref }}\`" >> $GITHUB_STEP_SUMMARY + echo "**Commit:** ${{ steps.commit-info.outputs.sha }}" >> $GITHUB_STEP_SUMMARY + echo "**Date:** ${{ steps.commit-info.outputs.date }}" >> $GITHUB_STEP_SUMMARY + echo "**Message:** ${{ steps.commit-info.outputs.message }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "✅ Baseline has been updated successfully." >> $GITHUB_STEP_SUMMARY + + - name: Upload new baseline + uses: actions/upload-artifact@v4 + with: + name: benchmark-baseline + path: benchmark_results.json + retention-days: 90 + + - name: Baseline updated successfully + run: | + echo "::notice::Baseline successfully updated to commit ${{ steps.commit-info.outputs.short_sha }}" From 650af6a618bd9e269fb5cdac2ec05093ff9d6eb6 Mon Sep 17 00:00:00 2001 From: LM Date: Wed, 5 Nov 2025 22:07:40 +0100 Subject: [PATCH 2/2] refactor(ci): lower upper bound --- .github/workflows/benchmark.yml | 4 ++-- .github/workflows/update-baseline.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 078275a..7f937ae 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,8 +32,8 @@ jobs: run: | # Run benchmarks with multiple sizes and save to JSON ./target/release/bench_throughput \ - --sizes 1000,10000,100000 \ - --iterations 50 \ + --sizes 1000,5000,10000 \ + --iterations 100 \ --format json \ --output benchmark_results.json diff --git a/.github/workflows/update-baseline.yml b/.github/workflows/update-baseline.yml index f13f5bf..46c1a24 100644 --- a/.github/workflows/update-baseline.yml +++ b/.github/workflows/update-baseline.yml @@ -11,7 +11,7 @@ on: iterations: description: 'Number of benchmark iterations' required: false - default: '50' + default: '100' type: string jobs: @@ -48,7 +48,7 @@ jobs: run: | echo "Running benchmarks for commit ${{ steps.commit-info.outputs.short_sha }}" ./target/release/bench_throughput \ - --sizes 1000,10000,100000 \ + --sizes 1000,5000,10000 \ --iterations ${{ inputs.iterations }} \ --format json \ --output benchmark_results.json