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

MergingIterator: use union for minHeap_ and maxHeap_ #27

Closed
rockeet opened this issue Oct 21, 2022 · 0 comments
Closed

MergingIterator: use union for minHeap_ and maxHeap_ #27

rockeet opened this issue Oct 21, 2022 · 0 comments

Comments

@rockeet
Copy link
Collaborator

rockeet commented Oct 21, 2022

This is a PR to upstream facebook/rocksdb#9035

Copied from facebook/rocksdb#9035

Current code use maxHeap_ as a unique_ptr, when using maxHeap_, minHeap_ is still a valid object while consuming memory.

This PR use C++ union for minHeap_ and maxHeap_, this reduces memory usage.

Since MergingIterator is a very low level component, all existing test passed can ensure correctness.

Relevant commits

4ffd72b use union for minHeap_ and maxHeap_
4c277ab MergingIterator: rearrange fields to reduce paddings (#9024)

@rockeet rockeet closed this as completed Oct 21, 2022
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

No branches or pull requests

1 participant