adjust benchmark sample count
This commit is contained in:
parent
2c34886dc5
commit
59886a80fd
|
@ -3,14 +3,17 @@ use image::{ImageReader, RgbImage};
|
||||||
use pi_frame_server::dither::{DitherMethod, DitheredImage, Palette};
|
use pi_frame_server::dither::{DitherMethod, DitheredImage, Palette};
|
||||||
|
|
||||||
fn criterion_benchmark(c: &mut Criterion) {
|
fn criterion_benchmark(c: &mut Criterion) {
|
||||||
|
let mut group = c.benchmark_group("dithering_benchmark");
|
||||||
|
|
||||||
let sample_file = "sample_0.tiff";
|
let sample_file = "sample_0.tiff";
|
||||||
let image: RgbImage = ImageReader::open(format!("samples/{sample_file}"))
|
let image: RgbImage = ImageReader::open(format!("samples/{sample_file}"))
|
||||||
.expect("file exists")
|
.expect("file exists")
|
||||||
.decode()
|
.decode()
|
||||||
.expect("file is valid")
|
.expect("file is valid")
|
||||||
.into_rgb8();
|
.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(|| {
|
b.iter(|| {
|
||||||
let mut method = DitherMethod::Atkinson.get_ditherer();
|
let mut method = DitherMethod::Atkinson.get_ditherer();
|
||||||
let mut result = DitheredImage::new(
|
let mut result = DitheredImage::new(
|
||||||
|
|
Loading…
Reference in a new issue