Skip to content

wc: use memchr crate for line counting#11871

Closed
xtqqczze wants to merge 2 commits into
uutils:mainfrom
xtqqczze:wc-memchr
Closed

wc: use memchr crate for line counting#11871
xtqqczze wants to merge 2 commits into
uutils:mainfrom
xtqqczze:wc-memchr

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

No description provided.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 17, 2026

Merging this PR will degrade performance by 42.87%

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

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

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation wc_lines_extreme_line_lengths[(100000, 200)] 1.6 ms 2.5 ms -35.35%
Simulation wc_lines_large_line_count[500000] 2.8 ms 4.6 ms -39.75%
Simulation wc_lines_variable_length[(50, 500)] 3.3 ms 5.6 ms -40.27%
Simulation wc_bytes_lines_synthetic[2000] 120.1 ms 210.2 ms -42.87%

Comparing xtqqczze:wc-memchr (4f29d53) with main (6130076)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 (c146e8a) during the generation of this report, so 6130076 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

❌ Simulation wc_lines_large_line_count[500000] 2.8 ms 4.6 ms -39.67%
❌ Simulation wc_lines_extreme_line_lengths[(100000, 200)] 1.6 ms 2.5 ms -35.02%
❌ Simulation wc_bytes_lines_synthetic[2000] 120.1 ms 210.2 ms -42.87%
❌ Simulation wc_lines_variable_length[(50, 500)] 3.3 ms 5.6 ms -40.2%

All regressions, but maybe we can use bytecount crate instead of memchr elsewhere: #11872

@xtqqczze xtqqczze closed this Apr 17, 2026
@xtqqczze xtqqczze deleted the wc-memchr branch April 17, 2026 00:58
@xtqqczze xtqqczze restored the wc-memchr branch April 17, 2026 12:54
@xtqqczze xtqqczze reopened this Apr 17, 2026
@xtqqczze xtqqczze closed this Apr 17, 2026
@xtqqczze xtqqczze deleted the wc-memchr branch April 17, 2026 14:22
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.

1 participant