use criterion::{black_box, criterion_group, criterion_main, Criterion}; use parser_combinator::testutil::json_object; use parser_combinator::Parser; pub fn criterion_benchmark(c: &mut Criterion) { let test_json = include_str!("../tests/joplin-cfg.json"); c.bench_function("parse_json", |b| { b.iter(|| json_object().parse(black_box(test_json))) }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);