Benchmark improvements

* CI: Clean offline; display cleaned bytes; one artifact upload
* Add missing csv bench to iai benchmarks
* Generate flamegraphs for benchmarks
* Validate benchmark results separately
This commit is contained in:
infogulch
2023-11-15 23:18:41 -06:00
parent c6f3700de1
commit 1c94624958
8 changed files with 315 additions and 74 deletions

View File

@@ -1,5 +1,8 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
#[cfg(not(target_os = "windows"))]
use pprof::criterion::{Output, PProfProfiler};
mod setup;
fn bench_criterion(c: &mut Criterion) {
@@ -13,9 +16,21 @@ fn bench_criterion(c: &mut Criterion) {
}
}
#[cfg(not(target_os = "windows"))]
fn config() -> Criterion {
Criterion::default()
.sample_size(20)
.with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)))
}
#[cfg(target_os = "windows")]
fn config() -> Criterion {
Criterion::default().sample_size(20)
}
criterion_group!(
name = bench_group;
config = Criterion::default().sample_size(10);
name = benches;
config = config();
targets = bench_criterion
);
criterion_main!(bench_group);
criterion_main!(benches);