name: Hotpath Profile
on:
pull_request:
paths:
- 'src/**'
- 'examples/**'
- 'Cargo.toml'
- '.github/workflows/hotpath.yml'
permissions:
contents: read
defaults:
run: { shell: bash }
env:
CASE: big-all-multi
ITERS: '5000'
jobs:
profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with: { fetch-depth: 0 }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: mkdir -p /tmp/metrics
- name: Head profile (timing + alloc)
env:
HOTPATH_OUTPUT_FORMAT: json
HOTPATH_OUTPUT_PATH: /tmp/metrics/head.json
run: cargo run --release --example profile --features 'hotpath,hotpath-alloc' -- "$CASE" "$ITERS"
- name: Checkout base
run: git checkout ${{ github.event.pull_request.base.sha }}
- name: Base profile (timing + alloc)
env:
HOTPATH_OUTPUT_FORMAT: json
HOTPATH_OUTPUT_PATH: /tmp/metrics/base.json
run: cargo run --release --example profile --features 'hotpath,hotpath-alloc' -- "$CASE" "$ITERS" || echo "base has no hotpath profiling; skipping"
- name: Save PR metadata
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "$PR_NUMBER" > /tmp/metrics/pr_number.txt
echo "$CASE" > /tmp/metrics/case.txt
- uses: actions/upload-artifact@v7
with:
name: hotpath-metrics
path: /tmp/metrics/
retention-days: 1