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(