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

refactor: reserve capacity in aggregate #2568

Merged

Conversation

JeremyRubin
Copy link
Contributor

Don't mean to inundate review with low hanging fruit, but I've just been fixing/cleaning stuff as I see it reading through the codebase.

In transaction aggregation, we add a bunch of stuff to unreserved vecs. This can be slow-ish as when we realloc we end up having to move stuff and wasteful because we may also over allocate (e.g., memory doubling). It really depends on the implementation.

We care about making this faster because it's in the path of relay and in the path of pools creating blocks.

Allocating ahead of time is simple enough.

@hashmap hashmap merged commit 563c674 into mimblewimble:master Feb 13, 2019
@hashmap
Copy link
Contributor

hashmap commented Feb 13, 2019

Thanks for you contribution!

@hashmap hashmap added this to the 1.0.2 milestone Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants