Skip to content

Commit 4c069c3

Browse files
authored
test: Instructions benchmark (#175)
## What? Adds an instructions benchmark. ## Why? Allows to check for performance regression in CI.
1 parent d5e8340 commit 4c069c3

File tree

6 files changed

+757
-21
lines changed

6 files changed

+757
-21
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
msrv: 1.85.0
1212
# Nightly Rust toolchain for checking no-std support.
1313
nightly: nightly-2025-11-02
14+
# Explicitly set the regression threshold for `yab` benchmarks
15+
CACHEGRIND_REGRESSION_THRESHOLD: 5%
1416

1517
jobs:
1618
build-msrv:
@@ -42,6 +44,12 @@ jobs:
4244
steps:
4345
- uses: actions/checkout@v4
4446

47+
- name: Install valgrind
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y --no-install-suggests --no-install-recommends valgrind
51+
valgrind --tool=cachegrind --version
52+
4553
- name: Install Rust
4654
uses: dtolnay/rust-toolchain@master
4755
with:
@@ -87,6 +95,9 @@ jobs:
8795
- name: Run equivalence
8896
run: cargo run -p elastic-elgamal --features serde --example equivalence
8997

98+
- name: Benchmark instructions
99+
run: cargo bench --bench instructions -- --vs pub:main --verbose --breakdown
100+
90101
build-nostd:
91102
runs-on: ubuntu-latest
92103

0 commit comments

Comments
 (0)