Fix quadratic performance during debug compression due to sections x symbols iteration.
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Apr 2014 00:48:01 +0000 (00:48 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Apr 2014 00:48:01 +0000 (00:48 +0000)
commit6715d6ec2eeaebd160bdc598c52ffa95c51a82ac
treeda05d539657536be74fd10060706c70712e19553
parent680311d2d2daf31f916a85951dd226ec34371840
Fix quadratic performance during debug compression due to sections x symbols iteration.

When fixing the symbols in each compressed section we were iterating
over all symbols for each compressed section. In extreme cases this
could snowball severely (5min uncompressed -> 35min compressed) due to
iterating over all symbols for each compressed section (large numbers of
compressed sections can be generated by DWARF type units).

To address this, build a map of the symbols in each section ahead of
time, and access that map if a section is being compressed. This brings
compile time for the aforementioned example down to ~6 minutes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207167 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/ELFObjectWriter.cpp