Skip to content

Commit 23f1a1e

Browse files
authored
Merge pull request #9989 from sylvestre/date-bench
date benchmark: keep only one value
2 parents 0ac3953 + ae204c0 commit 23f1a1e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/uu/date/benches/date_bench.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ fn setup_date_file(lines: usize, date_format: &str) -> NamedTempFile {
1919
}
2020

2121
/// Benchmarks processing a file containing simple ISO dates.
22-
#[divan::bench(args = [100, 1_000, 10_000])]
23-
fn file_iso_dates(bencher: Bencher, count: usize) {
22+
#[divan::bench]
23+
fn file_iso_dates(bencher: Bencher) {
24+
let count = 1_000;
2425
let file = setup_date_file(count, "2023-05-10 12:00:00");
2526
let path = file.path().to_str().unwrap();
2627

@@ -30,8 +31,9 @@ fn file_iso_dates(bencher: Bencher, count: usize) {
3031
}
3132

3233
/// Benchmarks processing a file containing dates with Timezone abbreviations.
33-
#[divan::bench(args = [100, 1_000, 10_000])]
34-
fn file_tz_abbreviations(bencher: Bencher, count: usize) {
34+
#[divan::bench]
35+
fn file_tz_abbreviations(bencher: Bencher) {
36+
let count = 1_000;
3537
// "EST" triggers the abbreviation lookup and double-parsing logic
3638
let file = setup_date_file(count, "2023-05-10 12:00:00 EST");
3739
let path = file.path().to_str().unwrap();
@@ -42,8 +44,9 @@ fn file_tz_abbreviations(bencher: Bencher, count: usize) {
4244
}
4345

4446
/// Benchmarks formatting speed using a custom output format.
45-
#[divan::bench(args = [1_000])]
46-
fn file_custom_format(bencher: Bencher, count: usize) {
47+
#[divan::bench]
48+
fn file_custom_format(bencher: Bencher) {
49+
let count = 1_000;
4750
let file = setup_date_file(count, "2023-05-10 12:00:00");
4851
let path = file.path().to_str().unwrap();
4952

0 commit comments

Comments
 (0)