Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/uu/date/benches/date_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ fn setup_date_file(lines: usize, date_format: &str) -> NamedTempFile {
}

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

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

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

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

Expand Down
Loading