mirror of
https://github.com/metrico/qryn.git
synced 2025-03-14 10:07:18 +00:00
tests to a separate mod; benchmarks; rust update
This commit is contained in:
@ -31,6 +31,11 @@ memchr = "2.7.4"
|
||||
|
||||
[dev-dependencies]
|
||||
wasm-bindgen-test = "0.3.34"
|
||||
criterion = { version = "0.5.1", features = ["html_reports"] }
|
||||
|
||||
[[bench]]
|
||||
name = "my_benchmark"
|
||||
harness = false
|
||||
|
||||
[profile.release]
|
||||
# Tell `rustc` to optimize for small code size.
|
||||
|
18
pyroscope/pprof-bin/benches/my_benchmark.rs
Normal file
18
pyroscope/pprof-bin/benches/my_benchmark.rs
Normal file
@ -0,0 +1,18 @@
|
||||
use pprof_bin::merge_prof;
|
||||
use pprof_bin::utest::get_test_pprof_data;
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
|
||||
fn merge_bench(pprofs: &Vec<Vec<u8>>) {
|
||||
|
||||
for pprof in pprofs {
|
||||
merge_prof(0, pprof.as_slice(), "process_cpu:samples:count:cpu:nanoseconds".to_string());
|
||||
}
|
||||
}
|
||||
|
||||
fn criterion_benchmark(c: &mut Criterion) {
|
||||
let pprofs = get_test_pprof_data();
|
||||
c.bench_function("merge", |b| b.iter(|| merge_bench(&pprofs)));
|
||||
}
|
||||
|
||||
criterion_group!(benches, criterion_benchmark);
|
||||
criterion_main!(benches);
|
Binary file not shown.
File diff suppressed because one or more lines are too long
1804
pyroscope/pprof-bin/src/utest.rs
Normal file
1804
pyroscope/pprof-bin/src/utest.rs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user