mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-05 05:28:12 +08:00
Add manually-runnable benchmarks for runtime profiling (#2005)
* Split benches into two files * Implement executor update bench * Restructure benchmarks * Unify usages of wrap network in scope * Remove unused imports * Fix oom bug * Remove bounding box impl
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use graph_craft::util::DEMO_ART;
|
||||
fn compile_to_proto(c: &mut Criterion) {
|
||||
use graph_craft::util::{compile, load_from_name};
|
||||
let mut c = c.benchmark_group("Compile Network cold");
|
||||
|
||||
for name in DEMO_ART {
|
||||
let network = load_from_name(name);
|
||||
c.bench_function(name, |b| b.iter_batched(|| network.clone(), |network| compile(black_box(network)), criterion::BatchSize::SmallInput));
|
||||
}
|
||||
}
|
||||
|
||||
criterion_group!(benches, compile_to_proto);
|
||||
criterion_main!(benches);
|
||||
Reference in New Issue
Block a user