29 lines
No EOL
970 B
Rust
29 lines
No EOL
970 B
Rust
use std::io::Cursor;
|
|
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
|
|
use wxbox_ar2::parse::Ar2v;
|
|
|
|
const KCRP20170825_235733_V06: (&[u8], &str) = (include_bytes!("KCRP20170825_235733_V06"), "KCRP20170825_235733_V06");
|
|
const KGWX20250518_165333_V06: (&[u8], &str) = (include_bytes!("KGWX20250518_165333_V06"), "KGWX20250518_165333_V06");
|
|
|
|
|
|
fn criterion_benchmark(c: &mut Criterion) {
|
|
let mut group = c.benchmark_group("parse");
|
|
|
|
for (test_file_bytes, name) in [KCRP20170825_235733_V06, KGWX20250518_165333_V06].iter() {
|
|
group.bench_with_input(
|
|
BenchmarkId::from_parameter(name),
|
|
test_file_bytes,
|
|
|b, bytes| {
|
|
b.iter(|| {
|
|
let mut r= Cursor::new(bytes.to_vec());
|
|
Ar2v::read(&mut r).unwrap();
|
|
});
|
|
}
|
|
);
|
|
}
|
|
|
|
group.finish();
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches); |