Zero-copy transmission with splice/sendfile
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 382
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 9
Description
Hi - it'd be handy if data could be sent through a stream without an (extra) userspace/kernelspace copy, which can be done with the splice system call on Linux and sendfile on some BSDs.
The idea would be to send the data frame's header directly, then pump with splice until all the bytes have been sent. Presumably it should do whatever send_data does if you try to send more bytes than SETTINGS_MAX_FRAME_SIZE.
I had a look at proto/streams/streams.rs and it might not actually need much type surgery - SendStream is already parameterised over the data it sends, so switching from Bytes to a sum of Bytes and a file descriptor + the range to splice should be quite possible.
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 in proto/streams/streams.rs and inspect how SendStream represents data and how send_data handles payloads larger than SETTINGS_MAX_FRAME_SIZE. Trace the existing frame-header and stream-send path, then compare the intended splice/sendfile behavior against the issue’s requirement to send the header and pump until all bytes are sent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100