neqo
neqo copied to clipboard
Consider optimizing `RecvStream::read` memory management
When reading off a stream trough RecvStream::read, unsurprisingly a lot of time is spent in (1) copy_from_slice and (2) de-allocating the now-no-longer-needed memory.
https://github.com/mozilla/neqo/blob/33ec4462d21b681df15e1647b79be05d426d8df5/neqo-transport/src/recv_stream.rs#L334-L374
Instead of the caller providing a buf to be copied into, maybe there is a way for RecvStream to return a chunk of the memory already allocated.
Also discussed in https://github.com/mozilla/neqo/pull/2620#pullrequestreview-2831178488.