mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 10:58:04 +08:00
Exclude executor teardown from the measured bench regions
This commit is contained in:
@@ -9,14 +9,14 @@ fn update_executor(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("Update Executor");
|
||||
bench_for_each_demo(&mut group, |name, g| {
|
||||
g.bench_function(name, |b| {
|
||||
b.iter_batched(
|
||||
b.iter_batched_ref(
|
||||
|| {
|
||||
let (_, proto_network) = setup_network(name);
|
||||
let empty = ProtoNetwork::default();
|
||||
let executor = DynamicExecutor::new(empty).unwrap();
|
||||
(executor, proto_network)
|
||||
},
|
||||
|(mut executor, network)| executor.update(std::hint::black_box(network)),
|
||||
|(executor, network)| executor.update(std::hint::black_box(std::mem::take(network))),
|
||||
criterion::BatchSize::SmallInput,
|
||||
)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user