Skip to content

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

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

tee: add splice() and tee() zero-copy fast-path#11943
oech3 wants to merge 1 commit intouutils: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 ×23

⚡ 2 improved benchmarks
✅ 311 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory tee_stdin_file[10000000] 102.8 KB 70.8 KB +45.22%
Simulation tee_stdin_file[10000000] 3,970.9 µs 169.2 µs ×23

Comparing oech3:tee-splice-m (d36fcc3) with main (2e04477)

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)

@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 2 times, most recently from 0dd27e6 to 6e9c6af Compare May 2, 2026 16:03
@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented May 6, 2026

3,970.9 µs -> 169.2 µs ×23

Do not merge this before merging #12131 since this PR masks benchmark result for all unix targets.
Also saved RAM usage is fake (#11597). (But it is bounded and scaled by input size).

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