✅ Add the benchmark

This commit is contained in:
eigenein committed 2023-05-08 22:43:28 +02:00
1 parent 0f437c39de
commit 2d2c85c18a
13 files changed
+46 -20

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
use std::fs::File;
use criterion::{criterion_group, criterion_main, Criterion};
use wotbreplay_parser::replay::Replay;
fn bench_read_data(criterion: &mut Criterion) {
let mut group = criterion.benchmark_group("read_data");
for path in [
"replays/20230429_0126__helaas_pindakaas.wotbreplay",
"replays/20230503_0027__helaas_pindakaas.wotbreplay",
"replays/20230429_1682194799_malinovka.wotbreplay",
] {
let mut replay = Replay::open(File::open(path).unwrap()).unwrap();
group.bench_function(path, |bencher| bencher.iter(|| replay.read_data().unwrap()));
}
group.finish();
}
criterion_group!(benches, bench_read_data);
criterion_main!(benches);