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:
Dennis Kobert
2024-09-25 10:52:41 +02:00
committed by GitHub
parent c5454af48b
commit f8c7ada572
25 changed files with 378 additions and 270 deletions
@@ -0,0 +1,23 @@
use criterion::{measurement::Measurement, BenchmarkGroup};
use futures::executor::block_on;
use graph_craft::{
proto::ProtoNetwork,
util::{compile, load_from_name, DEMO_ART},
};
use interpreted_executor::dynamic_executor::DynamicExecutor;
pub fn setup_network(name: &str) -> (DynamicExecutor, ProtoNetwork) {
let network = load_from_name(name);
let proto_network = compile(network);
let executor = block_on(DynamicExecutor::new(proto_network.clone())).unwrap();
(executor, proto_network)
}
pub fn bench_for_each_demo<M: Measurement, F>(group: &mut BenchmarkGroup<M>, f: F)
where
F: Fn(&str, &mut BenchmarkGroup<M>),
{
for name in DEMO_ART {
f(name, group);
}
}