mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 02:08:12 +08:00
Exclude teardown metrics from executors in the gungraun benchmark functions (#4336)
This commit is contained in:
@@ -18,9 +18,12 @@ fn setup_run_cached(name: &str) -> DynamicExecutor {
|
|||||||
|
|
||||||
#[library_benchmark]
|
#[library_benchmark]
|
||||||
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_run_cached)]
|
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_run_cached)]
|
||||||
pub fn run_cached(executor: DynamicExecutor) {
|
pub fn run_cached(executor: DynamicExecutor) -> DynamicExecutor {
|
||||||
let context = RenderConfig::default();
|
let context = RenderConfig::default();
|
||||||
black_box(futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), black_box(context))).unwrap());
|
black_box(futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), black_box(context))).unwrap());
|
||||||
|
|
||||||
|
// Return the executor so its teardown happens outside the measured section
|
||||||
|
executor
|
||||||
}
|
}
|
||||||
|
|
||||||
library_benchmark_group!(name = run_cached_group; benchmarks = run_cached);
|
library_benchmark_group!(name = run_cached_group; benchmarks = run_cached);
|
||||||
|
|||||||
@@ -13,9 +13,12 @@ fn setup_run_once(name: &str) -> DynamicExecutor {
|
|||||||
|
|
||||||
#[library_benchmark]
|
#[library_benchmark]
|
||||||
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_run_once)]
|
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_run_once)]
|
||||||
pub fn run_once(executor: DynamicExecutor) {
|
pub fn run_once(executor: DynamicExecutor) -> DynamicExecutor {
|
||||||
let context = application_io::RenderConfig::default();
|
let context = application_io::RenderConfig::default();
|
||||||
black_box(futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), black_box(context))).unwrap());
|
black_box(futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), black_box(context))).unwrap());
|
||||||
|
|
||||||
|
// Return the executor so its teardown happens outside the measured section
|
||||||
|
executor
|
||||||
}
|
}
|
||||||
|
|
||||||
library_benchmark_group!(name = run_once_group; benchmarks = run_once);
|
library_benchmark_group!(name = run_once_group; benchmarks = run_once);
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ fn setup_update_executor(name: &str) -> (DynamicExecutor, ProtoNetwork) {
|
|||||||
|
|
||||||
#[library_benchmark]
|
#[library_benchmark]
|
||||||
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_update_executor)]
|
#[benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "parametric-dunescape", "red-dress", "valley-of-spires"], setup = setup_update_executor)]
|
||||||
pub fn update_executor(setup: (DynamicExecutor, ProtoNetwork)) {
|
pub fn update_executor(setup: (DynamicExecutor, ProtoNetwork)) -> DynamicExecutor {
|
||||||
let (mut executor, network) = setup;
|
let (mut executor, network) = setup;
|
||||||
let _ = black_box(futures::executor::block_on(executor.update(black_box(network))));
|
let _ = black_box(futures::executor::block_on(executor.update(black_box(network))));
|
||||||
|
|
||||||
|
// Return the executor so its teardown happens outside the measured section
|
||||||
|
executor
|
||||||
}
|
}
|
||||||
|
|
||||||
library_benchmark_group!(name = update_group; benchmarks = update_executor);
|
library_benchmark_group!(name = update_group; benchmarks = update_executor);
|
||||||
|
|||||||
Reference in New Issue
Block a user