Skip to content

Commit 251cf8e

Browse files
committed
Migrate benchmarks to criterion and setup codspeed
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.
1 parent a657c08 commit 251cf8e

File tree

4 files changed

+548
-80
lines changed

4 files changed

+548
-80
lines changed

.github/workflows/bench.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
benchmarks:
12+
name: Benchmarks
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
lfs: true
18+
19+
- run: rustup toolchain install nightly --profile minimal --no-self-update
20+
- uses: cargo-bins/cargo-binstall@main
21+
- run: cargo binstall cargo-codspeed
22+
23+
# FIXME(swatinem): `cargo-codspeed` does currently not support `--all-features`
24+
- name: Build the benchmark target(s)
25+
run: cargo codspeed build --features=testing
26+
27+
- name: Run the benchmarks
28+
uses: CodSpeedHQ/action@v3
29+
with:
30+
run: cargo codspeed run
31+
token: ${{ secrets.CODSPEED_TOKEN }}

0 commit comments

Comments
 (0)