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

Optimize node allocation using ManagedBuffer #9

Open
lorentey opened this issue Mar 7, 2016 · 0 comments
Open

Optimize node allocation using ManagedBuffer #9

lorentey opened this issue Mar 7, 2016 · 0 comments
Milestone

Comments

@lorentey
Copy link
Collaborator

lorentey commented Mar 7, 2016

It may be worthwhile to change BTreeNode to derive from ManagedBuffer, replacing its Array stored properties with a large buffer that's allocated at once.

Splitting the raw buffer into multiple areas for the various components (keys, values, children) while observing their alignment requirements will be an interesting challenge. Also, new internal API needs to be designed to provide access to data stored in the buffer.

It is probably OK to allocate space for order elements even if not all slots are going to be filled; so we probably will not need to realloc nodes. However, leaf nodes should not allocate any space for child references that will never be set.

It is possible that the increased code complexity resulting from this change outweighs its performance advantages. (And it may even turn out that messing with data access will decrease performance.) So any implementation must demonstrate a clear win in benchmarks before it can be considered for merging.

@lorentey lorentey modified the milestone: 5.0 Nov 8, 2016
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