use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rg_formats::sm_msd; use std::fs; pub fn criterion_benchmark(c: &mut Criterion) { let base = ::std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let base = base.join("test_files"); let path = base.join("zk-test.sm"); let bytes = fs::read(path).expect("failed to read test file"); c.bench_function("parse sm file", |b| { b.iter(|| sm_msd::from_bytes(black_box(&bytes))) }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);