quic-rpc icon indicating copy to clipboard operation
quic-rpc copied to clipboard

Switch to postcard encoding

Open rklaehn opened this issue 1 year ago • 4 comments

We use postcard a lot at n0. I like it because it is a very simple format. I think it will still be fast enough despite all the varints.

rklaehn avatar Nov 03 '24 19:11 rklaehn

This is not so easy since tokio_serde does not have postcard as an encoding. https://docs.rs/tokio-serde/latest/tokio_serde/

Not that hard either, but it is not as simple as just changing a dependency...

rklaehn avatar Nov 04 '24 09:11 rklaehn

https://crates.io/crates/tokio-serde-postcard works well enough

dignifiedquire avatar Nov 04 '24 10:11 dignifiedquire

https://crates.io/crates/tokio-serde-postcard works well enough

Yeah, that is what I am using now. However, I have second thoughts about the whole tokio_serde crate. It is allocating for every single entry that is being serialized.

rklaehn avatar Nov 14 '24 09:11 rklaehn

Both crates are small enough to consider a more hand tailored code if needed though

fogodev avatar Nov 14 '24 14:11 fogodev