[DWARF] - Speedup handling of relocations in DWARFContextInMemory.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 15 May 2017 11:45:28 +0000 (11:45 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 15 May 2017 11:45:28 +0000 (11:45 +0000)
commit958b01aa691e031c674c974bf6aa5af3dc9d5be2
tree8d3c3aa845165e7de45840dd25bcc92f3ac03fa0
parentc5490e5a295bff69e24845d540d7fe8622a72a38
[DWARF] - Speedup handling of relocations in DWARFContextInMemory.

I am working on a speedup of building .gdb_index in LLD and
noticed that relocations that are proccessed in DWARFContextInMemory often uses
the same symbol in a row. This patch introduces caching to reduce the relocations
proccessing time.

For benchmark,
I took debug LLC binary objects configured with -ggnu-pubnames and linked it using LLD.

Link time without --gdb-index is about 4,45s.
Link time with --gdb-index: a) Without patch: 19,16s b) With patch: 15,52s
That means time spent on --gdb-index in this configuration is
19,16s - 4,45s = 14,71s (without patch) vs 15,52s - 4,45s = 11,07s (with patch).

Differential revision: https://reviews.llvm.org/D31136

llvm-svn: 303051
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp