Skip to content

Commit

Permalink
Bump brunch / benchmark dev-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroicKatora committed Sep 28, 2024
1 parent f33aee3 commit cd28c93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 27 deletions.
2 changes: 1 addition & 1 deletion canvas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 6 additions & 9 deletions canvas/benchmarks/bitpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
13 changes: 5 additions & 8 deletions canvas/benchmarks/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
15 changes: 6 additions & 9 deletions canvas/benchmarks/intcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit cd28c93

Please sign in to comment.