Skip to content

Commit

Permalink
ci: Enable continuous benchmarks through codspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Dec 11, 2024
1 parent 822fa9f commit b9f78ad
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CodSpeed

on:
push:
branches:
- master
pull_request:
branches:
- master
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install codspeed
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

- name: Build benchmarks
run: >
cargo codspeed build
bezout_coeffs
mem_io
prove_fib
verify_halt
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ arbitrary = { version = "1", features = ["derive"] }
assert2 = "0.3"
colored = "2.1"
clap = { version = "4", features = ["derive", "cargo", "wrap_help", "unicode", "string"] }
criterion = { version = "0.5", features = ["html_reports"] }
criterion = { package = "codspeed-criterion-compat", version = "2.7", features = ["html_reports"] }
directories = "5"
fs-err = "3.0"
get-size2 = { version = "0.1.2", features = ["derive"] }
Expand Down
8 changes: 1 addition & 7 deletions triton-vm/benches/bezout_coeffs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ criterion_main!(benches);
criterion_group!(
name = benches;
config = Criterion::default().sample_size(10);
targets = current_design<10>,
current_design<100>,
current_design<1_000>,
current_design<10_000>,
with_xgcd<10>,
with_xgcd<100>,
with_xgcd<1_000>,
targets = current_design<10_000>,
with_xgcd<10_000>,
);

Expand Down
2 changes: 1 addition & 1 deletion triton-vm/benches/cached_vs_jit_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ criterion_main!(benches);
criterion_group!(
name = benches;
config = Criterion::default().sample_size(10);
targets = prove_fib<1>, prove_fib<100>, prove_fib<1_000>,
targets = prove_fib<1_000>,
);

fn prove_fib<const N: u64>(c: &mut Criterion) {
Expand Down

0 comments on commit b9f78ad

Please sign in to comment.