cloudflare / cloudflare/quiche

Consider avoid copying on stream read

Open
#1,966 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
11.8k
Forks
1.1k
Avg merge
21h 9m
Merged PRs (30d)
6

Description

Currently stream_read populates user-provided slice by copying from internal representation. This intermediary copy is often unnecessary as raw stream data is often further deserialized and thus copied again.

Underneath stream data is stored as a series of RangeBuf. It could be beneficial to avoid unnecessary copy if there was a method like:

```
fn stream_recv_rangebuf(&mut self, stream_id: u64, len: usize, out: &mut [RangeBuf]) -> Result<(usize,bool)>
```

which populates slice with RangeBufs from internal storage up until requested `len` , or whatever is available in stream or up until `out` slice can't hold any more RangeBufs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.