Skip to content

Commit

Permalink
chore: remove unused bench function
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanvivien committed Oct 30, 2023
1 parent 5d439c3 commit b736073
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions benches/qr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::time::Duration;

use criterion::*;

use fast_qr::{QRBuilder, QRCode};
use fast_qr::QRBuilder;

fn bench_fastqr_qrcode(c: &mut Criterion) {
let bytes: &[u8] = b"https://example.com/";
Expand Down Expand Up @@ -60,31 +60,5 @@ fn bench_fastqr_qrcode(c: &mut Criterion) {
}
}

fn bench_mask(c: &mut Criterion) {
let mut group = c.benchmark_group("mask");
group.measurement_time(Duration::from_secs(10));
group.sample_size(200);

use fast_qr::datamasking::Mask;

let mut mat = black_box(QRCode::default(177));
for (mask, id) in [
(Mask::Checkerboard, "checkerboard"),
(Mask::HorizontalLines, "horizontal_lines"),
(Mask::VerticalLines, "vertical_lines"),
(Mask::DiagonalLines, "diagonal_lines"),
(Mask::LargeCheckerboard, "large_checkerboard"),
(Mask::Fields, "fields"),
(Mask::Diamonds, "diamonds"),
(Mask::Meadow, "meadow"),
] {
group.bench_function(id, |b| {
b.iter(|| fast_qr::datamasking::mask(&mut mat, mask))
});
}

group.finish();
}

criterion_group!(benches, bench_fastqr_qrcode);
criterion_main!(benches);

0 comments on commit b736073

Please sign in to comment.