mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: add pprof profiler/flamegraphs to all criterion benchmarks (#1425)
This commit is contained in:
@ -33,6 +33,7 @@ rand = "0.8"
|
||||
secp256k1 = { version = "0.24", features = [
|
||||
"rand-std",
|
||||
] }
|
||||
pprof = { version = "0.11", features = ["flamegraph", "frame-pointer", "criterion"] }
|
||||
|
||||
[features]
|
||||
alloc = []
|
||||
|
||||
@ -12,6 +12,7 @@ use bytes::BytesMut;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use ethnum::*;
|
||||
use hex_literal::hex;
|
||||
use pprof::criterion::{Output, PProfProfiler};
|
||||
use reth_rlp::*;
|
||||
|
||||
fn bench_encode(c: &mut Criterion) {
|
||||
@ -65,5 +66,9 @@ fn bench_decode(c: &mut Criterion) {
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, bench_encode, bench_decode);
|
||||
criterion_group! {
|
||||
name = benches;
|
||||
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
|
||||
targets = bench_encode, bench_decode
|
||||
}
|
||||
criterion_main!(benches);
|
||||
|
||||
Reference in New Issue
Block a user