Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to postcard encoding #108

Open
rklaehn opened this issue Nov 3, 2024 · 4 comments
Open

Switch to postcard encoding #108

rklaehn opened this issue Nov 3, 2024 · 4 comments

Comments

@rklaehn
Copy link
Collaborator

rklaehn commented Nov 3, 2024

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
Copy link
Collaborator Author

rklaehn commented Nov 4, 2024

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...

@dignifiedquire
Copy link
Contributor

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

@rklaehn
Copy link
Collaborator Author

rklaehn commented Nov 14, 2024

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.

@fogodev
Copy link
Collaborator

fogodev commented Nov 14, 2024

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

@n0bot n0bot bot added this to iroh Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants