Skip to content

Commit

Permalink
Do more iterations for some benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
bantonsson committed Sep 13, 2024
1 parent 6f7c6da commit dd73e5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ fn normalize_fnmut_string<F>(
// 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(
Expand All @@ -68,7 +68,7 @@ fn normalize_fnmut_string<F>(
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| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dd73e5b

Please sign in to comment.