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
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM
clang-tools-extra/clangd/index/dex/Iterator.cpp | ||
---|---|---|
41 ↗ | (On Diff #164462) | 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.