mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 11:48: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,20 @@
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use graph_craft::graphene_compiler::Executor;
|
||||
use graphene_std::transform::Footprint;
|
||||
|
||||
mod benchmark_util;
|
||||
use benchmark_util::{bench_for_each_demo, setup_network};
|
||||
|
||||
fn subsequent_evaluations(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("Subsequent Evaluations");
|
||||
let footprint = Footprint::default();
|
||||
bench_for_each_demo(&mut group, |name, g| {
|
||||
let (executor, _) = setup_network(name);
|
||||
futures::executor::block_on((&executor).execute(criterion::black_box(footprint))).unwrap();
|
||||
g.bench_function(name, |b| b.iter(|| futures::executor::block_on((&executor).execute(criterion::black_box(footprint)))));
|
||||
});
|
||||
group.finish();
|
||||
}
|
||||
|
||||
criterion_group!(benches, subsequent_evaluations);
|
||||
criterion_main!(benches);
|
||||
Reference in New Issue
Block a user