mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
While using dwarf5 `.debug_names` in internal large targets, we noticed a performance issue (around 10 seconds delay) while `lldb-vscode` tries to show `scopes` for a compile unit. Profiling shows the bottleneck is inside `DebugNamesDWARFIndex::GetGlobalVariables` which linearly search all index entries belongs to a compile unit. This patch improves the performance by using the compile units list to filter first before checking index entries. This significantly improves the performance (drops from 10 seconds => under 1 second) in the split dwarf situation because each compile unit has its own named index. --------- Co-authored-by: jeffreytan81 <jeffreytan@fb.com>