use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rg_formats::sm; 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_msd file", |b| { b.iter(|| sm::from_bytes(black_box(&bytes), &path)) }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);