Skip to content

Commit

Permalink
Migrate benchmarks to criterion and setup codspeed
Browse files Browse the repository at this point in the history
This migrates the pyreport benchmarks to `criterion` via the codspeed compatibility layer.
Additionally, this also creates a CI job to run the benchmarks within the codspeed runner, and upload the results.
  • Loading branch information
Swatinem committed Nov 19, 2024
1 parent a657c08 commit 251cf8e
Show file tree
Hide file tree
Showing 4 changed files with 548 additions and 80 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Benchmarks

on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:

jobs:
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true

- run: rustup toolchain install nightly --profile minimal --no-self-update
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-codspeed

# FIXME(swatinem): `cargo-codspeed` does currently not support `--all-features`
- name: Build the benchmark target(s)
run: cargo codspeed build --features=testing

- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
Loading

0 comments on commit 251cf8e

Please sign in to comment.