Skip to content

join: optimize locale collation performance with hybrid comparison - #10393

Open
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:join-perf
Open

join: optimize locale collation performance with hybrid comparison#10393
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:join-perf

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Performance improvements:

  • 5.18x faster than upstream locale collation
  • 35% faster than GNU join for Unicode data
  • Maintains full locale collation correctness

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@ChrisDryden

Copy link
Copy Markdown
Collaborator

Were you expecting the results of this change to show up here? #10391

}

// If both are pure ASCII, byte comparison is sufficient for most locales
if left.is_ascii() && right.is_ascii() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is not a valid assumption:

Heres a one liner that shows that for punctuation byte order does not always equal collation order. Its part of the reason the test was changed in this pr I think

echo -e "ab:d 1\nabc:d 2" | LC_ALL=en_US.UTF-8 join --check-order - <(echo -e "ab:d x\nabc:d y")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh, well spotted

@sylvestre

Copy link
Copy Markdown
Contributor Author

Were you expecting the results of this change to show up here? #10391

yeah, i am confused why it isn't detected

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

Performance improvements:
- 5.18x faster than upstream locale collation
- 35% faster than GNU join for Unicode data
- Maintains full locale collation correctness
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 148.57 MB (+972 KB, +0.64%)

Significant per-binary changes:
  ls         2.11 MB ->    3.25 MB  (+1.14 MB, +54.36%)
  mkfifo     1.16 MB ->    1.08 MB  (-76 KB, -6.42%)
  mknod      1.16 MB ->    1.09 MB  (-76 KB, -6.38%)
  mkdir      1.16 MB ->    1.09 MB  (-72 KB, -6.04%)

@codspeed-hq

codspeed-hq Bot commented Aug 9, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 4.76%

⚠️ 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

❌ 2 regressed benchmarks
✅ 345 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation ls_recursive_deep_tree[(200, 2)] 3.4 ms 3.7 ms -6.13%
Simulation du_summarize_balanced_tree[(5, 4, 10)] 15.5 ms 16 ms -3.38%

Tip

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


Comparing sylvestre:join-perf (472116d) with main (7cc5cfe)2

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.

  2. No successful run was found on main (bfe212f) during the generation of this report, so 7cc5cfe was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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