Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Pre-allocate buffer for serialization #107

Open
abhinav opened this issue Jan 14, 2016 · 1 comment
Open

Pre-allocate buffer for serialization #107

abhinav opened this issue Jan 14, 2016 · 1 comment

Comments

@abhinav
Copy link
Contributor

abhinav commented Jan 14, 2016

It's easy to calculate the final size of the serialized object in advance. We should do that when serializing and allocate the write buffer with that size in advance so that we don't end up resizing it later.

The Protocol could expose a function that allows you to calculate the serialized size of an object, or if that specific protocol doesn't have guarantees around that, -1.

@abhinav
Copy link
Contributor Author

abhinav commented Jan 15, 2016

CC @recht

Let me know if the serialized size thing becomes an issue and I'll prioritize this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant