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

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 this to RC 4 (TBD) in V19 May 25, 2019
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-functional change performance Performance/resource utilization improvement
Projects
No open projects
V19
RC 4 (2019-06-11)
Development

Successfully merging this pull request may close these issues.

None yet

4 participants