Skip to content

sort: use locale_cmp when all selectors have equal ordering#13350

Open
lauchimoon wants to merge 2 commits into
uutils:mainfrom
lauchimoon:numeric-fix
Open

sort: use locale_cmp when all selectors have equal ordering#13350
lauchimoon wants to merge 2 commits into
uutils:mainfrom
lauchimoon:numeric-fix

Conversation

@lauchimoon

@lauchimoon lauchimoon commented Jul 10, 2026

Copy link
Copy Markdown

Fixes #13319.

When all selectors return Ordering::Equal in compare_by, the last resort was to use byte-by-byte comparison, ignoring the locale.

The change now resorts to use locale_cmp if i18n-collator is enabled.

@codspeed-hq

codspeed-hq Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 11.73%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 4 regressed benchmarks
✅ 327 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation sort_numeric[500000] 1 s 1.4 s -26.32%
Simulation sort_key_field[500000] 767 ms 836.9 ms -8.36%
Simulation sort_case_insensitive[500000] 251.6 ms 268.9 ms -6.42%
Simulation sort_dictionary_order[500000] 1 s 1.1 s -3.92%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing lauchimoon:numeric-fix (de6f5a2) with main (cd80f63)

Open in CodSpeed

Footnotes

  1. 46 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

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

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.

sort -rn produces output different from gnusort

1 participant