optimize load spec; update logging; parallelize output

This commit is contained in:
2026-02-27 05:00:28 -07:00
parent d8134095ab
commit 92b36e09b7
12 changed files with 195 additions and 172 deletions

View File

@@ -16,31 +16,14 @@ fn benchmark(c: &mut Criterion) {
LOG_LEVEL.set(LogLevel::Warning).ok();
let args = Args {
devices: regex::Regex::new(".*").unwrap(),
classic: false,
env: env(),
};
c.bench_function("process_specs", |b| {
b.iter(|| {
DeviceConfigBundle::process_specs(Specification::compile(&args)).unwrap();
DeviceConfigBundle::process_specs(Specification::compile(&args).unwrap()).unwrap();
});
});
}
fn benchmark_classic(c: &mut Criterion) {
LOG_LEVEL.set(LogLevel::Warning).ok();
let args = Args {
devices: regex::Regex::new(".*").unwrap(),
classic: true,
env: env(),
};
c.bench_function("from_spec", |b| {
b.iter(|| {
for spec in Specification::compile(&args) {
DeviceConfigBundle::from_spec(spec).unwrap();
}
});
});
}
criterion_group!(benches, benchmark, benchmark_classic);
criterion_group!(benches, benchmark);
criterion_main!(benches);