From 59886a80fd337bd2d8c3815b6f3e586a6a02d032 Mon Sep 17 00:00:00 2001 From: "Champlin, Saji" Date: Wed, 31 Jul 2024 13:31:44 -0500 Subject: [PATCH] adjust benchmark sample count --- benches/dithering.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benches/dithering.rs b/benches/dithering.rs index 6cd6235..f0aa944 100644 --- a/benches/dithering.rs +++ b/benches/dithering.rs @@ -3,14 +3,17 @@ use image::{ImageReader, RgbImage}; use pi_frame_server::dither::{DitherMethod, DitheredImage, Palette}; fn criterion_benchmark(c: &mut Criterion) { + let mut group = c.benchmark_group("dithering_benchmark"); + let sample_file = "sample_0.tiff"; let image: RgbImage = ImageReader::open(format!("samples/{sample_file}")) .expect("file exists") .decode() .expect("file is valid") .into_rgb8(); + group.sample_size(20); - c.bench_with_input(BenchmarkId::new("dither", "sample_0"), &image, |b, i| { + group.bench_with_input(BenchmarkId::new("dither", "sample_0"), &image, |b, i| { b.iter(|| { let mut method = DitherMethod::Atkinson.get_ditherer(); let mut result = DitheredImage::new(