-
Notifications
You must be signed in to change notification settings - Fork 741
merkledb
-- preallocate bytes.Buffer
in codec
#1900
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
Conversation
Code looks correct to me but I'm just curious to see if we can get tighter bounds on the pre-allocation to see if we can avoid re-allocations later. If we're concerned with the performance of our codec here we could also consider adding specific benchmarks tests for the codec to see if this is helping us. |
@joshua-kim Added estimates based on the number of children |
For what it's worth I expect this to be a pretty modest speedup. If we find that we're doing a ton of memory allocations here we can always bump the size estimates. |
Why this should be merged
May prevent doing some memory allocations
How this works
Self-explanatory
How this was tested
Existing UT