aboutsummaryrefslogtreecommitdiff
path: root/benches/analyzers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'benches/analyzers.rs')
-rw-r--r--benches/analyzers.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/benches/analyzers.rs b/benches/analyzers.rs
index 61aee22..2cbb87c 100644
--- a/benches/analyzers.rs
+++ b/benches/analyzers.rs
@@ -1,4 +1,4 @@
-use criterion::{black_box, criterion_group, criterion_main, Criterion};
+use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput};
use evtclib::Compression;
macro_rules! analyzer_benchmark {
@@ -7,17 +7,21 @@ macro_rules! analyzer_benchmark {
let log = evtclib::process_file($log, Compression::Zip).unwrap();
let analyzer = log.analyzer().unwrap();
- c.bench_function(&format!("analyzers/{}/is_cm", $boss), |b| {
+ let mut group = c.benchmark_group(&format!("analyzers/{}", $boss));
+ group.throughput(Throughput::Elements(1));
+
+ group.bench_function("is_cm", |b| {
b.iter(|| {
black_box(analyzer.is_cm());
})
});
- c.bench_function(&format!("analyzers/{}/outcome", $boss), |b| {
+ group.bench_function("outcome", |b| {
b.iter(|| {
black_box(analyzer.outcome());
})
});
+ group.finish();
}
}
}