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