Skip to content

numfmt: add --grouping option#10511

Open
mattsu2020 wants to merge 2 commits intouutils:mainfrom
mattsu2020:numfmt-grouping-only
Open

numfmt: add --grouping option#10511
mattsu2020 wants to merge 2 commits intouutils:mainfrom
mattsu2020:numfmt-grouping-only

Conversation

@mattsu2020
Copy link
Contributor

Summary

  • Add --grouping option to numfmt
  • Apply locale-specific grouping separators in output
  • Enforce conflicts between grouping and --to / --format
  • Add regression tests for grouping behavior

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 27, 2026

Merging this PR will degrade performance by 9.11%

❌ 9 regressed benchmarks
✅ 279 untouched benchmarks
⏩ 38 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation numfmt_round_modes[("up", 10000)] 36.1 ms 39 ms -7.52%
Simulation numfmt_padding[(10000, 50)] 51.3 ms 53.4 ms -3.82%
Simulation numfmt_round_modes[("down", 10000)] 36.3 ms 39 ms -7.08%
Simulation numfmt_round_modes[("towards-zero", 10000)] 36.2 ms 38.9 ms -6.94%
Simulation numfmt_large_numbers_si[10000] 38.1 ms 41.5 ms -8.07%
Simulation numfmt_to_si_precision[10000] 37.2 ms 40.2 ms -7.36%
Simulation numfmt_to_iec[10000] 35.4 ms 38.4 ms -7.74%
Simulation numfmt_to_si[10000] 35.3 ms 38.4 ms -7.98%
Simulation numfmt_from_si[10000] 33.9 ms 37.3 ms -9.11%

Comparing mattsu2020:numfmt-grouping-only (ae1d7de) with main (289d701)

Open in CodSpeed

Footnotes

  1. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

1 similar comment
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

1 similar comment
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the unsafe is way too big

please give your to AI the guidance to avoid duplication of code ;)

we probably have what we need in src/uucore/src/lib/features/i18n/decimal.rs already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@sylvestre
Copy link
Contributor

please tell your AI to avoid duplication of code and make it smaller

@sylvestre
Copy link
Contributor

Merge issue

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/pr/bounded-memory. tests/pr/bounded-memory is passing on 'main'. Maybe you have to rebase?

@sylvestre
Copy link
Contributor

sorry - many jobs have been failing

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/cut/bounded-memory is no longer failing!
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

- add --grouping CLI and validation\n- apply locale decimal/grouping separators in formatting\n- support locale-aware parsing without libc localeconv\n- keep max-whitespace behavior and related tests
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cut/bounded-memory is no longer failing!
Note: The gnu test tests/basenc/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

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

Comments