feat output artifacts to tmp; add bench & profiling; minor fixes
This commit is contained in:
28
benches/benchmark.rs
Normal file
28
benches/benchmark.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
use skyforge::{Args, DeviceConfigBundle, Specification};
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn benchmark(c: &mut Criterion) {
|
||||
let args = Args {
|
||||
devices: regex::Regex::new(".*").unwrap(),
|
||||
env: skyforge::cli::EnvVars {
|
||||
spec_path: PathBuf::from("./demo/spec"),
|
||||
tmpl_path: PathBuf::from("./demo/tmpl"),
|
||||
out_path: PathBuf::from("./demo/out"),
|
||||
log_path: PathBuf::from("./demo/log"),
|
||||
},
|
||||
};
|
||||
|
||||
c.bench_function("compile", |b| {
|
||||
b.iter(|| {
|
||||
for spec in Specification::compile(&args) {
|
||||
DeviceConfigBundle::from_spec(spec)
|
||||
.unwrap()
|
||||
.output_artifacts();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, benchmark);
|
||||
criterion_main!(benches);
|
||||
Reference in New Issue
Block a user