You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
numfmt: reuse formatting buffers across lines and fields - #16531
Merging this PR will improve performance by 20.62%
1 warning
⚠️11 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.
No successful run was found on main (36079aa) during the generation of this report, so fca3de1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Congrats! The gnu test tests/id/smack is no longer failing!
Congrats! The gnu test tests/mkdir/smack-no-root is no longer failing!
Congrats! The gnu test tests/mkdir/smack-root is no longer failing!
Congrats! The gnu test tests/df/skip-rootfs is now passing!
vpashaiev
changed the title
numfmt: reuse formatting buffers across lines and fields
numfmt: reuse formatting buffers across lines and fields (perf +29%)
Nov 16, 2026
thanks for working on this!
The speedup is good, but the change brings in more code than it needs: a padding block repeated 4 times, hand-built digits and two wrappers nothing calls (see inline).
Please also check the red Tests job.
vpashaiev
changed the title
numfmt: reuse formatting buffers across lines and fields (perf +29%)
numfmt: reuse formatting buffers across lines and fields (perf +20%)
Nov 16, 2026
vpashaiev
changed the title
numfmt: reuse formatting buffers across lines and fields (perf +20%)
numfmt: reuse formatting buffers across lines and fields
Nov 18, 2026
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formatting each number allocates several temporary
Stringbuffers acrosstransform_to, grouping, padding, andformat_string.Reuse a single
Stringbuffer across lines and arguments and write formatted output into it in place.Benchmarks (
cargo bench --package uu_numfmt --bench numfmt_bench):+68%in CodSpeed)+29%in CodSpeed)--to=si): 380,763 allocs (6.56 MB) -> 562 allocs (235 KB)