Skip to content

shuf: use memchr in split_seps#11358

Draft
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:memchr/split_seps
Draft

shuf: use memchr in split_seps#11358
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:memchr/split_seps

Conversation

@xtqqczze

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Congrats! The gnu test tests/expand/bounded-memory is now passing!

@codspeed-hq

codspeed-hq Bot commented Mar 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 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 improved benchmarks
❌ 1 regressed benchmark
✅ 336 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation shuf_lines[100000] 32.2 ms 36.4 ms -11.69%
Memory shuf_lines[100000] 10.3 MB 9.8 MB +5.31%
Memory shuf_repeat_sampling[50000] 1.2 MB 1.1 MB +4.72%

Tip

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


Comparing xtqqczze:memchr/split_seps (79ac9cc) with main (9846eb8)

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.

@oech3

oech3 commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

It touches data twice. I think it is why perf -13.49% .

@oech3

oech3 commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

You might try to scan first few byte and predict capacity.

@xtqqczze

xtqqczze commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

first we should improve benchmarks to include short average line length: #11364

@oech3

oech3 commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

You might try to scan first few byte and predict capacity.

Can we get length of one SIMD scan? Averadge is enough (no need to get from system)?

@xtqqczze
xtqqczze force-pushed the memchr/split_seps branch from 40cc40e to 651812e Compare April 15, 2026 14:26
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/unexpand/bounded-memory is now passing!

@xtqqczze
xtqqczze force-pushed the memchr/split_seps branch from 651812e to 79ac9cc Compare July 16, 2026 09:36
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