Skip to content

Add comprehensive benchmarking suite #3

Add comprehensive benchmarking suite

Add comprehensive benchmarking suite #3

Workflow file for this run

name: Performance Benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
benchmark:
name: Run Performance Benchmarks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [0.8, 0.9, 0.10, 0.11, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
uses: ljharb/actions/node/install@main
with:
node-version: ${{ matrix.node-version }}
- name: Install benchmark dependencies
run: cd benchmark && npm install
# For PRs: Run benchmarks and compare against committed baseline
- name: Run benchmarks and compare against baseline
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "==== Running benchmarks and comparing against baseline ===="
# Run benchmarks using the compare script that uses the committed baseline
npm run benchmark:compare
# Print the Node.js version for debugging
echo "Benchmark completed on Node.js version: $(node --version)"
# For pushes to main: Run benchmarks against the committed baseline
- name: Run benchmarks on main branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
# Run benchmarks against the committed baseline
npm run benchmark:compare
# Print the Node.js version for debugging
echo "Benchmark completed on Node.js version: $(node --version)"