27 lines
No EOL
886 B
Rust
27 lines
No EOL
886 B
Rust
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
|
|
use wxbox_ar2::parse;
|
|
|
|
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(|| {
|
|
parse(bytes.to_vec()).unwrap();
|
|
});
|
|
}
|
|
);
|
|
}
|
|
|
|
group.finish();
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches); |