From 746194a1d4a9146eb26c9f6f8bf1d384d71c24c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Antonsson?= Date: Fri, 13 Sep 2024 17:31:38 +0200 Subject: [PATCH] Do more iterations for some benchmarks --- .../benches/normalization_utils.rs | 4 ++-- .../benches/benchmarks/credit_cards_bench.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/trace-normalization-benches/benches/normalization_utils.rs b/benchmark/trace-normalization-benches/benches/normalization_utils.rs index cf7f3e27b..bbc6a2ca6 100644 --- a/benchmark/trace-normalization-benches/benches/normalization_utils.rs +++ b/benchmark/trace-normalization-benches/benches/normalization_utils.rs @@ -50,8 +50,8 @@ fn normalize_fnmut_string( // We only need to measure for a small time since the function is very fast group.warm_up_time(Duration::from_secs(1)); group.measurement_time(Duration::from_secs(2)); - group.sample_size(200); group.sampling_mode(criterion::SamplingMode::Flat); + group.sample_size(500); for case in cases { group.bench_with_input( @@ -68,7 +68,7 @@ fn normalize_fnmut_string( b.iter_batched_ref( || { let mut strings = Vec::with_capacity(elements); - (0..elements).for_each(|_| strings.push(case.to_owned())); + (0..elements).for_each(|_| strings.push(black_box(case.to_owned()))); strings }, |strings| { diff --git a/benchmark/trace-obfuscation-benches/benches/benchmarks/credit_cards_bench.rs b/benchmark/trace-obfuscation-benches/benches/benchmarks/credit_cards_bench.rs index 54d87f927..d8c1f6441 100644 --- a/benchmark/trace-obfuscation-benches/benches/benchmarks/credit_cards_bench.rs +++ b/benchmark/trace-obfuscation-benches/benches/benchmarks/credit_cards_bench.rs @@ -26,7 +26,7 @@ fn bench_is_card_number(c: &mut Criterion, function_name: &str, validate_luhn: b group.warm_up_time(Duration::from_secs(1)); group.measurement_time(Duration::from_secs(2)); group.sampling_mode(criterion::SamplingMode::Flat); - group.sample_size(200); + group.sample_size(500); let ccs = [ "378282246310005", " 378282246310005",