-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Improve FragmentTombstones() speed by lazily initializing seq_set_
#10848
Conversation
add compaction range del aggregator to microbench
52b362d
to
3990dbe
Compare
seq_set_
seq_set_
@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cbi42 has updated the pull request. You must reimport the pull request before landing. |
seq_set_
seq_set_
@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice finding, LGTM!
Thanks for the review! |
Summary: FragmentedRangeTombstoneList has a member variable
seq_set_
that contains the sequence numbers of all range tombstones in a set. The set is constructed inFragmentTombstones()
and is used only inFragmentedRangeTombstoneList::ContainsRange()
which only happens during compaction. This PR moves the initialization ofseq_set_
toFragmentedRangeTombstoneList::ContainsRange()
. This should speed upFragmentTombstones()
when the range tombstone list is used for read/scan requests, this is true for most cases whenFragmentTombstones()
is called for range tombstones of the mutable memtable. Microbench shows the speed improvement to be ~45%.Test plan:
python3 tools/db_crashtest.py whitebox --simple --verify_iterator_with_expected_state_one_in=5
.range_del_aggregator_bench
to benchmark speed ofFragmentTombstones()
: