chore: upgrade lambda runtime from 1.1.0-rc1 to 1.1.1 #28
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Benchmark | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "src/**" | |
| - "benches/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| - name: Install stable toolchain | |
| run: rustup update stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-bench- | |
| - name: Run benchmarks on PR branch | |
| run: | | |
| cargo bench --bench e2e_body_forwarding -- --noplot --save-baseline pr | |
| - name: Checkout main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| clean: false | |
| - name: Run benchmarks on main branch | |
| run: | | |
| cargo bench --bench e2e_body_forwarding -- --noplot --save-baseline main | |
| - name: Checkout PR branch again for comparison | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: false | |
| - name: Install critcmp | |
| run: cargo install critcmp | |
| - name: Compare benchmarks | |
| id: compare | |
| run: | | |
| echo "## Benchmark Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| critcmp main pr >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| # Check for regressions > 10% by parsing critcmp output | |
| # critcmp outputs factors like 1.15x for 15% slower, we check for factors > 1.10 | |
| COMPARISON=$(critcmp main pr --threshold 10 2>&1 || true) | |
| # Look for lines where pr is slower than main (factor > 1.10 in the comparison) | |
| REGRESSION=$(echo "$COMPARISON" | awk -F',' 'NR>1 && $5 > 1.10 {print}') | |
| if [ -n "$REGRESSION" ]; then | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "## ⚠️ Performance Regression Detected (>10%)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "$REGRESSION" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "regression=true" >> $GITHUB_OUTPUT | |
| echo "$REGRESSION" | |
| else | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "✅ No significant performance regression detected." >> $GITHUB_STEP_SUMMARY | |
| echo "regression=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Save benchmark results | |
| run: | | |
| mkdir -p benchmark-results | |
| cp $GITHUB_STEP_SUMMARY benchmark-results/summary.md | |
| echo "${{ github.event.pull_request.number }}" > benchmark-results/pr_number.txt | |
| echo "${{ steps.compare.outputs.regression }}" > benchmark-results/regression.txt | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: benchmark-results/ | |
| - name: Fail if regression detected | |
| if: steps.compare.outputs.regression == 'true' | |
| run: | | |
| echo "Performance regression >10% detected!" | |
| exit 1 |