Skip to content

tee: add splice() and tee() zero-copy fast-path#11943

Open
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:tee-splice-m
Open

tee: add splice() and tee() zero-copy fast-path#11943
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:tee-splice-m

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Apr 22, 2026

Closes #11466 .

> tee </tmp/huge |pv >/dev/null
^C58GiB 0:00:01 [2.58GiB/s] 
> tee-splice </tmp/huge |pv >/dev/null
^C.6GiB 0:00:02 [38.4GiB/s]

@oech3 oech3 force-pushed the tee-splice-m branch 3 times, most recently from cfb3c51 to 8db29e1 Compare April 22, 2026 13:14
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 22, 2026

Merging this PR will improve performance by 19.71%

⚠️ 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
✅ 95 untouched benchmarks
⏩ 266 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation ls_recursive_balanced_tree[(6, 4, 15)] 50.9 ms 48.9 ms +4.01%
Simulation tee_stdin_file[10000000] 232.8 µs 169 µs +37.77%

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:tee-splice-m (179a204) with main (d09f351)

Open in CodSpeed

Footnotes

  1. 266 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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/pid-pipe. tests/tail/pid-pipe is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@oech3 oech3 marked this pull request as ready for review April 22, 2026 14:44
@oech3

This comment was marked as resolved.

Comment thread src/uu/tee/src/tee.rs Outdated
@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 26, 2026

I'm considering something like

curl-splice url://to/lage.iso | tee /dev/nvmeXnYm /dev/nvmeZnWm > saved.iso

if you feel this is a joke. Unfortunately, I don't know how to get curl-splice.

@oech3 oech3 force-pushed the tee-splice-m branch 5 times, most recently from 772a3ad to 795c27c Compare April 28, 2026 09:43
@oech3

This comment was marked as outdated.

@oech3 oech3 force-pushed the tee-splice-m branch 5 times, most recently from ceba8b4 to f66fbd1 Compare April 29, 2026 17:49
@oech3

This comment was marked as outdated.

@oech3 oech3 force-pushed the tee-splice-m branch 2 times, most recently from 96fdadd to 71918b9 Compare May 1, 2026 03:40
@oech3 oech3 force-pushed the tee-splice-m branch 3 times, most recently from 6e9c6af to d36fcc3 Compare May 6, 2026 03:02
@oech3

This comment was marked as outdated.

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented May 15, 2026

Simulation tee_stdin_file[10000000] 232.8 µs 169 µs +37.77%

CodSpeed is not a good tool for measuring I/O performance. I think pv or time is much better for the case.

@oech3 oech3 force-pushed the tee-splice-m branch 2 times, most recently from 9b58e02 to 179a204 Compare May 15, 2026 13:34
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.

tee: use splice and tee syscalls for performance

2 participants