criterion_group!(benches, vis_crate_aware);
criterion_main!(benches);
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
use rust_llm_tidy_vis::narrow_vis_in_tree;
#[path = "common.rs"]
mod common;
fn vis_crate_aware(c: &mut Criterion) {
let mut group = c.benchmark_group("vis_crate_aware");
for (name, sources) in common::CRATE_FIXTURES {
let (tree, reexports, owned) = common::build_crate_context(sources);
let total_bytes: u64 = owned.iter().map(|(_, s)| s.len() as u64).sum();
group.throughput(Throughput::Bytes(total_bytes));
group.bench_function(*name, |bencher| {
bencher.iter(|| {
for (path, src) in &owned {
let floor = tree.floor_for(std::path::Path::new(path));
let out =
narrow_vis_in_tree(src, floor, &reexports).expect("fixture must parse");
std::hint::black_box(out);
}
});
});
}
group.finish();
}