If the current element is already beyond advanceTo()'s DocID, just return instead of doing binary search. This simple optimization saves up to 6-7% performance,
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM
clang-tools-extra/clangd/index/dex/Iterator.cpp | ||
---|---|---|
41 | Maybe add a short comment that this gives performance boost? |
Comment Actions
Add a short comment on why calling lower_bound is redundant. Also, don't spend extra line on return by inverting the condition.
Maybe add a short comment that this gives performance boost?
Otherwise this looks redundant when reading the code