Skip to content

Conversation

loskutov
Copy link
Contributor

The conversion routine used to parse the time into a BigDecimal and normalize it into nanoseconds; however, for an input like 1e6666666666668320 it would require allocating a number with 6666666666668329 zeroes, which is obviously suboptimal (and redundant, as Duration uses u64 for seconds).

Fixes #8634.

The conversion routine used to parse the time into a BigDecimal and normalize it into nanoseconds; however, for an input like 1e6666666666668320 it would require allocating a number with 6666666666668329 zeroes, which is obviously suboptimal (and redundant, as `Duration` uses `u64` for seconds).

Fixes uutils#8634.
Copy link

codspeed-hq bot commented Sep 25, 2025

CodSpeed Performance Report

Merging #8740 will not alter performance

Comparing loskutov:patch-1 (3d727ca) with main (7dbeb8f)

Summary

✅ 55 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/overlay-headers is no longer failing!

@cakebaker cakebaker merged commit e028c6b into uutils:main Sep 25, 2025
118 of 120 checks passed
@cakebaker
Copy link
Contributor

Thanks for your PR!

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.

uucore/parse_time: passing large number to from_str leads to high CPU usage
2 participants