labath added a comment.

Thanks for the tip about commenting out DW_AT_ranges code. I wanted to do some 
measurements, but I couldn't find a non-contrived non-trivial code base to try 
this on (with c++ most compile units always get DW_AT_ranges due to all of the 
ODR linkage brought in by templates). The results are very interesting. The 
test setup is: release (no assert) lldb debugging a debug clang with 
accelerator tables (to avoid debug info indexing overshadowing everything). I'm 
running `rel/lldb dbg/clang -o "image lookup -a 0x7234567" -b` as a benchmark, 
running it 10 times and averaging. The address is a random address inside 
clang's .text section.

With the current code, where we get this information via DW_AT_ranges from most 
compile units (only 30 CUs don't have it), the command takes 5.15 (+/- .04) 
seconds. With the DW_AT_ranges code commented out, where we get information by 
traversing the DIE tree, it takes 10.38 (+/- 0.05) seconds. With both 
DW_AT_ranges *and* DIE code removed (information retrieved via line tables), 
the time is 6.85 (+/- 0.03) seconds. These results make sense to me, as line 
tables are much simpler and easier to parse than DIE trees, and this makes it 
possible to avoid parsing a lot of compile units

So, not only does this remove code, and improve llvm consistency, it also makes 
things faster, if only for a limited amount of users (those building with 
clang<=3.3, or those building huge amounts of C code  -- the patch is nfc for 
the rest). Sounds like a win-win-win to me (?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78489/new/

https://reviews.llvm.org/D78489



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to