cp /dev/stdin /dev/stdout <file lacks splice optimization (and socket, tty?)
Open
Nobody has claimed this yet.
U - cp
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
$ truncate -s 1PB /tmp/huge
$ cp /dev/stdin /dev/stdout </tmp/huge|pv>/dev/null
3.77GiB 0:00:01 [3.77GiB/s]
$ cat /tmp/huge|cp /dev/stdin /dev/stdout |pv>/dev/null
60.5GiB 0:00:02 [30.5GiB/s]
We should investigate usage of copy_stream on socket too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two cp commands in the issue and tracing the copy_stream path used by cp. Investigate whether stdin/stdout, sockets, and ttys can use the intended splice optimization; done means the relevant cases are evaluated and the performance gap or supported optimization is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100