Skip to content

Commit

Permalink
add profiler & flamegraph at benches
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaucube committed Nov 25, 2024
1 parent 07a3f34 commit 3e6db17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions benches/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# benchmarks
*Note: we're starting to benchmark & profile Sonobe, current results are pre-optimizations.*

- Benchmark
- Run: `cargo bench`
- To run a specific benchmark, for example Nova's benchmark, run: `cargo bench --bench=nova`
- Profiling
- eg. `cargo bench --bench=nova -- --profile-time 3`

Run: `cargo bench`

To run a specific benchmark, for example Nova benchmark, run: `cargo bench --bench=nova`
10 changes: 9 additions & 1 deletion benches/nova.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use criterion::*;
use pprof::{
criterion::{Output, PProfProfiler},
flamegraph::Options,
};

use ark_bn254::{constraints::GVar as bn_GVar, Fr as bn_Fr, G1Projective as bn_G};
use ark_grumpkin::{constraints::GVar as grumpkin_GVar, Projective as grumpkin_G};
Expand Down Expand Up @@ -70,5 +74,9 @@ fn bench_nova_ivc(c: &mut Criterion) {
}
}

criterion_group!(benches, bench_nova_ivc);
criterion_group! {
name = benches;
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
targets = bench_nova_ivc
}
criterion_main!(benches);

0 comments on commit 3e6db17

Please sign in to comment.