test: add pprof flamgegraph bench (#6712)

This commit is contained in:
Matthias Seitz
2024-02-21 19:41:27 +01:00
committed by GitHub
parent 84b13286f0
commit 4487886fa2
3 changed files with 8 additions and 1 deletions

1
Cargo.lock generated
View File

@ -6969,6 +6969,7 @@ dependencies = [
"metrics",
"parking_lot 0.12.1",
"paste",
"pprof",
"proptest",
"rand 0.8.5",
"reth-eth-wire",

View File

@ -62,6 +62,7 @@ paste = "1.0"
rand = "0.8"
proptest.workspace = true
criterion.workspace = true
pprof = { workspace = true, features = ["criterion", "flamegraph"] }
assert_matches.workspace = true
tempfile.workspace = true
serde_json.workspace = true

View File

@ -2,6 +2,7 @@
use criterion::{
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
};
use pprof::criterion::{Output, PProfProfiler};
use proptest::{
prelude::*,
strategy::ValueTree,
@ -233,5 +234,9 @@ fn truncate_basefee(
});
}
criterion_group!(truncate, txpool_truncate);
criterion_group! {
name = truncate;
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
targets = txpool_truncate
}
criterion_main!(truncate);