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

Investigate deeply nested message reuse #29

Open
danburkert opened this issue Sep 11, 2017 · 0 comments
Open

Investigate deeply nested message reuse #29

danburkert opened this issue Sep 11, 2017 · 0 comments

Comments

@danburkert
Copy link
Collaborator

Reddit user nwydo points out that prost doesn't do as good of a job reusing deeply nested message allocations as the reference C++ implementation, due to differences between Vec and RepeatedPtrField. While I think this isn't necessarily as critical for prost since nested message fields are inline (which often has the effect of flattening the hierarchy), it could be significant for encoding/decoding n-ary tree-like structures. Should be relatively easy to write a benchmark for it.

One possible solution is to add a clear+merge all-in-one operation to Message (perhaps called Message::decode_into), which could re-use existing deeply nested allocations.

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

No branches or pull requests

1 participant