summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorTroy Johnson <troyj@meta.com>2022-10-18 08:03:10 -0700
committerTroy Johnson <troyj@meta.com>2022-10-18 08:21:14 -0700
commit10c0eca25523e3bf1872522bde4693aaa55513e0 (patch)
tree2e9056aad9406fe33448befab80a337007f6fd78 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parenta8e9742bd44daa4632b07ccc37a6da8236781fa6 (diff)
[clang][Lexer] Speed up HeaderSearch when there are many HeaderMaps
HeaderSearch already uses a caching system to avoid duplicate searches, but the initial cold miss can take a long time if a build system has supplied thousands of HeaderMaps. For this case, the SearchDirs vector begins with those HeaderMaps, so a cache miss requires testing if the sought filename is present in each of those maps. Instead, we can consolidate the keys of those HeaderMaps into one StringMap and then each cache miss can skip directly to the correct HeaderMap or continue its search beyond the initial sequence of HeaderMaps. In testing on TUs with ~15000 SearchDirs where the initial 99% are HeaderMaps, time spent in Clang was reduced by 15%. This patch is expected to be neutral for SearchDir vectors that do not begin with HeaderMaps. Differential Revision: https://reviews.llvm.org/D135801
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions