Skip to content

Commit bcfd143

Browse files
authored
Add support for Codspeed performance testing (#20)
1 parent 221f217 commit bcfd143

File tree

4 files changed

+135
-11
lines changed

4 files changed

+135
-11
lines changed

.github/workflows/ml-kem.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "Cargo.*"
99
push:
1010
branches: master
11+
workflow-dispatch:
1112

1213
defaults:
1314
run:
@@ -21,7 +22,7 @@ jobs:
2122
set-msrv:
2223
uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master
2324
with:
24-
msrv: 1.74.0
25+
msrv: 1.76.0
2526

2627
no_std:
2728
needs: set-msrv
@@ -69,6 +70,23 @@ jobs:
6970
- run: cargo test
7071
- run: cargo test --all-features
7172

73+
bench:
74+
needs: set-msrv
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: RustCrypto/actions/cargo-cache@master
79+
- uses: dtolnay/rust-toolchain@master
80+
with:
81+
toolchain: stable
82+
- run: cargo install cargo-codspeed
83+
- run: cargo codspeed build
84+
- name: Run benchmarks
85+
uses: CodSpeedHQ/action@v2
86+
with:
87+
token: ${{ secrets.CODSPEED_TOKEN }}
88+
run: cargo codspeed run
89+
7290
cross:
7391
needs: set-msrv
7492
strategy:

Cargo.lock

Lines changed: 114 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ml-kem/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ hex = "0.4.3"
3030
hex-literal = "0.4.1"
3131
rand = "0.8.5"
3232
crypto-common = { version = "0.1.6", features = ["rand_core"] }
33+
codspeed-criterion-compat = "2.6.0"
3334

3435
[[bench]]
3536
name = "mlkem"

ml-kem/benches/mlkem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use ::kem::{Decapsulate, Encapsulate};
2-
use criterion::{criterion_group, criterion_main, Criterion};
2+
use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};
33
use crypto_common::rand_core::CryptoRngCore;
44
use hybrid_array::{Array, ArraySize};
55
use ml_kem::*;

0 commit comments

Comments
 (0)