Skip to content

performance improvements - #355

Open
anastygnome wants to merge 12 commits into
uutils:mainfrom
anastygnome:perf/performance-improvements
Open

anastygnome wants to merge 12 commits into
uutils:mainfrom
anastygnome:perf/performance-improvements

Conversation

@anastygnome

@anastygnome anastygnome commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #350

@anastygnome
anastygnome force-pushed the perf/performance-improvements branch 4 times, most recently from d8861cd to afd20cd Compare November 10, 2026 11:31
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.75776% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.73%. Comparing base (0612ea5) to head (bfea048).

Files with missing lines Patch % Lines
src/items/builder.rs 97.84% 4 Missing ⚠️
src/items/offset.rs 99.18% 1 Missing ⚠️
src/items/time.rs 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
- Coverage   98.97%   98.73%   -0.25%     
==========================================
  Files          21       17       -4     
  Lines        4696     4890     +194     
  Branches      143      159      +16     
==========================================
+ Hits         4648     4828     +180     
- Misses         47       61      +14     
  Partials        1        1              
Flag Coverage Δ
macos_latest 98.73% <98.75%> (-0.25%) ⬇️
ubuntu_latest 98.73% <98.75%> (-0.25%) ⬇️
windows_latest 13.64% <47.61%> (+1.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 18.22%

2 warnings

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 15 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 15 improved benchmarks
✅ 6 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ parse_invalid_input 39.6 µs 30.6 µs +29.57%
⚡ parse_now 30.1 µs 23.2 µs +29.56%
⚡ parse_extended_year_relative 56.7 µs 44.8 µs +26.42%
⚡ parse_relative_time 48 µs 38.7 µs +24.28%
⚡ parse_weekday 41.7 µs 34.1 µs +22.24%
⚡ parse_datetime_with_delta 70.4 µs 58.5 µs +20.3%
⚡ parse_datetime_ending_in_z 61.1 µs 51.3 µs +19.23%
⚡ parse_ctime_format 71.8 µs 60.9 µs +17.98%
⚡ parse_extended_year_rollover 81.1 µs 69.3 µs +16.93%
⚡ parse_relative_time_complex 62.1 µs 53.2 µs +16.71%
⚡ parse_timezone_offset 59.1 µs 51 µs +15.86%
⚡ parse_yesterday 31.1 µs 27.6 µs +12.53%
⚡ parse_epoch_timestamp 11.6 µs 10.5 µs +10.83%
⚡ parse_tomorrow 30.4 µs 27.5 µs +10.7%
⚡ parse_date_slash_format 27.2 µs 26.3 µs +3.39%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing anastygnome:perf/performance-improvements (bfea048) with main (0612ea5)

Open in CodSpeed

@sylvestre

Copy link
Copy Markdown
Contributor

I really like you didn't touch tests :)

@anastygnome

Copy link
Copy Markdown
Contributor Author

I did ?

Comment thread src/items/offset.rs Resolved
@sylvestre

Copy link
Copy Markdown
Contributor

@anastygnome

Copy link
Copy Markdown
Contributor Author

https://github.com/uutils/parse_datetime/tree/main/tests these

well, I just rewrote the parser in place and rechecked every rule, want me to add some?

@anastygnome
anastygnome force-pushed the perf/performance-improvements branch 8 times, most recently from 8b8bcb7 to 60bac2b Compare November 11, 2026 11:05
@anastygnome
anastygnome force-pushed the perf/performance-improvements branch 3 times, most recently from 24cb12a to 201ca9e Compare November 12, 2026 10:08
@anastygnome
anastygnome force-pushed the perf/performance-improvements branch 2 times, most recently from 7998859 to 352c682 Compare November 12, 2026 13:17
@anastygnome
anastygnome marked this pull request as ready for review November 12, 2026 13:19
@sylvestre

Copy link
Copy Markdown
Contributor

please remove the fixup!

@anastygnome
anastygnome force-pushed the perf/performance-improvements branch from 352c682 to b9aae81 Compare November 12, 2026 13:24
@anastygnome
anastygnome marked this pull request as draft November 12, 2026 13:27
@anastygnome
anastygnome force-pushed the perf/performance-improvements branch from b9aae81 to 8e6b080 Compare November 12, 2026 13:27
@anastygnome

Copy link
Copy Markdown
Contributor Author

@sylvestre done

@anastygnome
anastygnome force-pushed the perf/performance-improvements branch 13 times, most recently from e0f4d45 to 0d40353 Compare November 14, 2026 09:24
Choose the date parser from the first character instead of trying every form.
Parse shared time and offset prefixes once to reduce backtracking in common ISO inputs.
Choose the keyword or numeric path from the first character instead of trying failed alternatives.
Route text and numeric ordinals separately before parsing either form.
Skip the separated-date parser when the input is clearly a compact ISO date.
Avoid unnecessary timestamp and timezone parser probes on common inputs.
Use the crate-level limit in year parsing instead of keeping a second copy.
@anastygnome
anastygnome force-pushed the perf/performance-improvements branch from 0d40353 to bfea048 Compare November 15, 2026 12:30
@anastygnome
anastygnome marked this pull request as ready for review November 15, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants