Skip to content

Commit

Permalink
feat: add benchmark for FilteredImageReader basic use
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Jul 30, 2024
1 parent b9864ff commit 7ccf66f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rxing::oned::{
};
use rxing::pdf417::PDF417Reader;
use rxing::qrcode::QRCodeReader;
use rxing::MultiFormatReader;
use rxing::{FilteredImageReader, MultiFormatReader};
use rxing::{BinaryBitmap, BufferedImageLuminanceSource, Reader};
use std::path::Path;

Expand Down Expand Up @@ -206,6 +206,17 @@ fn multi_barcode_benchmark(c: &mut Criterion) {
});
}

fn multi_barcode_filtered_reader_benchmark(c: &mut Criterion) {
let mut image = get_image("test_resources/blackbox/multi-1/1.png");
c.bench_function("multi_barcode", |b| {
b.iter(|| {

let mut reader = GenericMultipleBarcodeReader::new(FilteredImageReader::new(MultiFormatReader::default()));
let _res = reader.decode_multiple(&mut image);
});
});
}

criterion_group!(
benches,
aztec_benchmark,
Expand All @@ -224,6 +235,7 @@ criterion_group!(
telepen_benchmark,
upca_benchmark,
upce_benchmark,
multi_barcode_benchmark
multi_barcode_benchmark,
multi_barcode_filtered_reader_benchmark,
);
criterion_main!(benches);

0 comments on commit 7ccf66f

Please sign in to comment.