You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add new SegmentDeserializer field into marshaller (that takes ArraySegment instead of byte[]). the backward compatibility is maintained as the new deserializer fallbacks to older byte[] (with some overhead though) based serializer if not defined explicitly
when deserializing messages, don't always allocate a new byte array, but instead reuse a thread-local byte array that is allocated for that purpose. That byte array is always-growing, but it's a weak reference, so the runtime can free the memory if it grows too big and memory is needed (the expectation is users shouldn't really use messages larger >X MB or so at that makes little practical sense - they could always use streaming).
new ParseFrom(buffer, offset, count) API from Protobuf 3.5+ is used to allow parsing messages from byte array that is potentially larger than the message size. Users would need to regenerate their .proto generate code to benefit from this optimization.
@apolcyn I temporarily interrupted work on this PR to take care of other things (cmake & test flakiness). I'll get back to it when I'm back from vacation.
lockbot
locked as resolved and limited conversation to collaborators
Jul 24, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Progress towards fixing #13236.