Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove unnecessary copies when using lmdb cursors #2026

Merged
merged 2 commits into from
May 30, 2019

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented May 24, 2019

The cursors used when iterating tables in lmdb already contain the objects in question as a pair (key -> value). A lot of places wrap first/second to make it more readable, but inadvertently end up copying the objects. I've replaced them with references.

Also found a few other places where a copy is made unnecessarily so have used references there as well.

@wezrule wezrule added this to the V19.0 milestone May 24, 2019
@wezrule wezrule requested a review from argakiig May 24, 2019 14:05
@wezrule wezrule self-assigned this May 24, 2019
Copy link
Contributor

@clemahieu clemahieu left a comment

Choose a reason for hiding this comment

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

Good catch.

@wezrule wezrule added the performance Performance/resource utilization improvement label May 27, 2019
@wezrule wezrule merged commit 815f319 into nanocurrency:master May 30, 2019
@wezrule wezrule deleted the remove_unnecessary_coppies branch May 30, 2019 19:16
@guilhermelawless
Copy link
Contributor

guilhermelawless commented May 31, 2019

@wezrule i suppose the copy constructor can't be deleted? Will be a hard habbit to break.

argakiig pushed a commit that referenced this pull request Jun 11, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
non-functional change performance Performance/resource utilization improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants