Skip to content

Conversation

@CrazyRoka
Copy link
Contributor

This PR optimizes the memory allocation strategy in the split utility when handling chunked output.

Moved the Vec initialization outside of the for loop to avoid unnecessary malloc and free calls, leading to a more efficient execution path

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/follow-name (fails in this run but passes 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)

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 3, 2026

Merging this PR will improve performance by 13.25%

⚡ 1 improved benchmark
✅ 283 untouched benchmarks
⏩ 38 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation split_number_chunks 286.3 µs 252.8 µs +13.25%

Comparing CrazyRoka:reuse-split-buffer (bc5bebc) with main (26a29ca)

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.

@CrazyRoka CrazyRoka marked this pull request as ready for review February 4, 2026 07:37
@sylvestre
Copy link
Contributor

Merging this PR will improve performance by 13.26%

bravo!

@sylvestre
Copy link
Contributor

@samueltardieu maybe it is hard but maybe something that clippy could detect ? :)

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