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

Reduce memory copies of serialized buffers #1175

Merged
merged 3 commits into from
Dec 10, 2024
Merged

Reduce memory copies of serialized buffers #1175

merged 3 commits into from
Dec 10, 2024

Conversation

youben11
Copy link
Member

@youben11 youben11 commented Dec 9, 2024

Readers were automatically casted to Messages which cost a memory copy. It's now required to explicitly make this conversion (copy).

Copy link
Collaborator

@aPere3 aPere3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @youben11 !

Thanks a lot for the PR, this is a very welcome improvement. On a general note, I would say that:

  • The explicit casting is much much better. Thanks for that.
  • The overloading of the fromProto I am not convinced. I would rather go for a two different entry points (like fromProtoMessage and fromProtoReader) to make things even clearer. This is essentially a matter of taste though, so feel free to ignore :)

Other than that, it looks good !

Readers were automatically casted to Messages which cost a memory copy.
It's now required to explicitly make this conversion (copy).
reduce memory usage by avoiding unecessary copy
we inline the server key serialization so that we only make small copies
@youben11 youben11 merged commit 0dd8bec into main Dec 10, 2024
28 of 30 checks passed
@youben11 youben11 deleted the fix/keyset_deser branch December 10, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants