wxbox/crates/ar2/benches/parse_benchmark.rs
core e4dcb48878
Some checks are pending
Verify Latest Dependencies / Verify Latest Dependencies (push) Waiting to run
build and test / wxbox - latest (push) Waiting to run
chore: praise be the clippy gods
2025-05-19 10:38:23 -04:00

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);