adjust benchmark sample count
All checks were successful
cargo_test_bench / Run Tests (push) Successful in 1m29s
cargo_test_bench / Run Benchmarks (push) Successful in 2m27s

This commit is contained in:
Champlin, Saji 2024-07-31 13:31:44 -05:00
parent 2c34886dc5
commit 59886a80fd

View file

@ -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(