Skip to content

split: preliminary for distinguishing read/write errors (& reflink)#13105

Open
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:split-unbuf
Open

split: preliminary for distinguishing read/write errors (& reflink)#13105
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:split-unbuf

Conversation

@oech3

@oech3 oech3 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

GNU shows file path which caused I/O error. We need to separate out read/write instead of using std::io::copy to do same thing. Add copy method.
(This refactoring is useful for adding reflink support in the future BTW...)

@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 9.75%

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

⚡ 1 improved benchmark
✅ 322 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation split_bytes 311.7 µs 284 µs +9.75%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing oech3:split-unbuf (9ad6387) with main (e73b8a6)

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 marked this pull request as ready for review June 26, 2026 18:59
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/tty-eof (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout-group (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

Comment thread src/uu/split/src/split.rs
Strategy::Bytes(chunk_size) => {
let mut writer = ByteChunkWriter::new(chunk_size, settings)?;
copy(&mut reader, &mut writer)
Ok(writer.copy(&mut reader, io_blksize)?)

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.

While CodSpeed reported performance gain, this is double buffered by BufReader. I'll fix it at different PR.

@oech3 oech3 marked this pull request as draft June 27, 2026 05:44
@oech3 oech3 marked this pull request as ready for review June 27, 2026 14:37
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