Run preprocessing on benchmarks and fix deadlock (#3230)

This commit is contained in:
Dennis Kobert
2025-09-27 12:36:29 +02:00
committed by GitHub
parent ffc74273cc
commit 84e44810d2
8 changed files with 14 additions and 8 deletions
@@ -1,5 +1,5 @@
use criterion::measurement::Measurement;
use criterion::{BenchmarkGroup, Criterion, black_box, criterion_group, criterion_main};
use criterion::{BenchmarkGroup, Criterion, criterion_group, criterion_main};
use graph_craft::graphene_compiler::Executor;
use graph_craft::proto::ProtoNetwork;
use graph_craft::util::{DEMO_ART, compile, load_from_name};
@@ -16,7 +16,7 @@ fn update_executor<M: Measurement>(name: &str, c: &mut BenchmarkGroup<M>) {
c.bench_function(name, |b| {
b.iter_batched(
|| (executor.clone(), proto_network.clone()),
|(mut executor, network)| futures::executor::block_on(executor.update(black_box(network))),
|(mut executor, network)| futures::executor::block_on(executor.update(std::hint::black_box(network))),
criterion::BatchSize::SmallInput,
)
});