Add iai versions of the runtime benchmarks (#3016)

* Include graph runtime benchmarks in ci regression run

* Update benchmarking workflow

* Remove ci script changes
This commit is contained in:
Dennis Kobert
2025-08-07 00:48:25 +02:00
committed by GitHub
parent e003389526
commit 9b8935d201
5 changed files with 85 additions and 0 deletions
@@ -0,0 +1,27 @@
use graph_craft::util::*;
use graphene_std::Context;
use iai_callgrind::{black_box, library_benchmark, library_benchmark_group, main};
use interpreted_executor::dynamic_executor::DynamicExecutor;
fn setup_run_cached(name: &str) -> DynamicExecutor {
let network = load_from_name(name);
let proto_network = compile(network);
let executor = futures::executor::block_on(DynamicExecutor::new(proto_network)).unwrap();
// Warm up the cache by running once
let context: Context = None;
let _ = futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), context.clone()));
executor
}
#[library_benchmark]
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_run_cached)]
pub fn run_cached(executor: DynamicExecutor) {
let context: Context = None;
black_box(futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), black_box(context))).unwrap());
}
library_benchmark_group!(name = run_cached_group; benchmarks = run_cached);
main!(library_benchmark_groups = run_cached_group);