[SourceManager] Improve getFileIDLocal.
Prune the search space -- If we know offset(LastFileIDLookup) < SearchOffset, we can prune the initial binary-search range from [0, end) to [LastFileIDlookup, end). It reduces the binary search scan by ~30%. SemaExpr.cpp: 1393437 -> 1035426 FindTarget.cpp: 1275930 -> 920087 Linux kernel: getFileIDLocal: 2.45% -> 2.15% Differential Revision: https://reviews.llvm.org/D135132
Loading
Please sign in to comment