From cd28c93a73ca71a70f2a3919cb8faef369272259 Mon Sep 17 00:00:00 2001 From: Andreas Molzer Date: Sat, 28 Sep 2024 13:24:50 +0200 Subject: [PATCH] Bump brunch / benchmark dev-dependency --- canvas/Cargo.toml | 2 +- canvas/benchmarks/bitpack.rs | 15 ++++++--------- canvas/benchmarks/conversion.rs | 13 +++++-------- canvas/benchmarks/intcast.rs | 15 ++++++--------- 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/canvas/Cargo.toml b/canvas/Cargo.toml index 8e08ab1..f66354f 100644 --- a/canvas/Cargo.toml +++ b/canvas/Cargo.toml @@ -16,7 +16,7 @@ image-texel = { path = "../texel", version = "0.3.0" } bytemuck = "1.1" [dev-dependencies] -brunch = "0.2.5" +brunch = "0.6.1" [dev-dependencies.image] version = "0.24" default-features = false diff --git a/canvas/benchmarks/bitpack.rs b/canvas/benchmarks/bitpack.rs index 5c49d99..bacc1c6 100644 --- a/canvas/benchmarks/bitpack.rs +++ b/canvas/benchmarks/bitpack.rs @@ -69,13 +69,10 @@ fn main() { }, ]; - let mut benches = tests.map(|convert| { - Bench::new("framebuf::conversion::main", &convert.name()) - .with(convert.prepare().expect("Failed to setup benchmark")) - }); - - // Technically, we're not meant to call this directly but this makes me sad.. Why are we forced - // to use a macro to setup such a simple data structure. Not like the macro makes it possible - // to define any more complicated thing than a linear list as well.. - brunch::analyze(&mut benches[..]) + let mut benches = brunch::Benches::default(); + benches.extend(tests.map(|convert| { + Bench::new(format!("framebuf::conversion::main::{}", convert.name())) + .run(convert.prepare().expect("Failed to setup benchmark")) + })); + benches.finish(); } diff --git a/canvas/benchmarks/conversion.rs b/canvas/benchmarks/conversion.rs index 826e921..343976f 100644 --- a/canvas/benchmarks/conversion.rs +++ b/canvas/benchmarks/conversion.rs @@ -213,17 +213,14 @@ fn main() { }, ]; - let mut benches = tests.map(|convert| { + let mut benches = brunch::Benches::default(); + benches.extend(tests.map(|convert| { let bench = match convert.prepare() { Ok(bench) => bench, Err(err) => panic!("Failed to setup benchmark {:?}: {:?}", convert, err), }; - Bench::new("framebuf::conversion::main", &convert.name()).with(bench) - }); - - // Technically, we're not meant to call this directly but this makes me sad.. Why are we forced - // to use a macro to setup such a simple data structure. Not like the macro makes it possible - // to define any more complicated thing than a linear list as well.. - brunch::analyze(&mut benches[..]) + Bench::new(format!("framebuf::conversion::main::{}", convert.name())).run(bench) + })); + benches.finish(); } diff --git a/canvas/benchmarks/intcast.rs b/canvas/benchmarks/intcast.rs index 262dd0f..20e4d2c 100644 --- a/canvas/benchmarks/intcast.rs +++ b/canvas/benchmarks/intcast.rs @@ -101,13 +101,10 @@ fn main() { }, ]; - let mut benches = tests.map(|convert| { - Bench::new("framebuf::conversion::main", &convert.name()) - .with(convert.prepare().expect("Failed to setup benchmark")) - }); - - // Technically, we're not meant to call this directly but this makes me sad.. Why are we forced - // to use a macro to setup such a simple data structure. Not like the macro makes it possible - // to define any more complicated thing than a linear list as well.. - brunch::analyze(&mut benches[..]) + let mut benches = brunch::Benches::default(); + benches.extend(tests.map(|convert| { + Bench::new(format!("framebuf::conversion::main::{}", convert.name())) + .run(convert.prepare().expect("Failed to setup benchmark")) + })); + benches.finish(); }