Skip to content

Commit

Permalink
Use gray_bench_image in filter benchmarks (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherphil authored May 27, 2024
1 parent 1cbe8d6 commit 77055ec
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,7 @@ mod benches {
($name:ident, $kernel_size:expr, $image_size:expr, $function_name:ident) => {
#[bench]
fn $name(b: &mut Bencher) {
let image =
GrayImage::from_fn($image_size, $image_size, |x, y| Luma([(x + y % 3) as u8]));

let image = gray_bench_image($image_size, $image_size);
let kernel: Vec<i32> = (0..$kernel_size * $kernel_size).collect();
let kernel = Kernel::new(&kernel, $kernel_size, $kernel_size);
b.iter(|| {
Expand All @@ -1037,7 +1035,6 @@ mod benches {
#[bench]
fn $name(b: &mut Bencher) {
let image = rgb_bench_image($image_size, $image_size);

let kernel: Vec<i32> = (0..$kernel_size * $kernel_size).collect();
let kernel = Kernel::new(&kernel, $kernel_size, $kernel_size);
b.iter(|| {
Expand Down

0 comments on commit 77055ec

Please sign in to comment.