RangeDelAggregator::StripeRep::Invalidate() to be skipped if empty (#5312)

Summary:
RangeDelAggregator::StripeRep::Invalidate() clears up several vectors. If we know there isn't anything to there, we can safe these small CPUs. Profiling shows that it sometimes take non-negligible amount of CPU. Worth a small optimization.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5312

Differential Revision: D15380511

Pulled By: siying

fbshipit-source-id: 53c5f34c33b4cb1e743643c6086ac56d0b84ec2e
This commit is contained in:
Siying Dong 2019-05-16 15:20:19 -07:00 committed by Facebook Github Bot
parent 29a198564d
commit f82e693a31

View File

@ -320,8 +320,10 @@ class RangeDelAggregator {
RangeDelPositioningMode mode);
void Invalidate() {
InvalidateForwardIter();
InvalidateReverseIter();
if (!IsEmpty()) {
InvalidateForwardIter();
InvalidateReverseIter();
}
}
bool IsRangeOverlapped(const Slice& start, const Slice& end);