pgwire
pgwire copied to clipboard
Remove tokio codec usage for zero-copy message layer
The encoder API of tokio-codec requires a copy when writing data, we can further seek to see if it's possible to refactor this behaviour to streamline data generation.
I have been working on this by changing encode method to accept a AsyncWriteExt. However, I quickly realized that it may introduces a a lot more system calls by using write_ functions directly on small data.
Overall, I think the best way is not to eliminate all copies, but only for those large chunk of bytes. This is better implemented at BufMut level to support non-continuous byte buffer.