[lld] r257017 - ELF: Improve performance of string table construction.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 15:05:58 PST 2016


On Thu, Jan 14, 2016 at 7:25 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > In total, this patch improves link time of lld itself about 12%
> > (3.50 seconds -> 3.08 seconds.)
>
> That is quite slow, is in a debug build that you are linking? What is
> the size of the string table if you use discard_locals? I wonder if we
> are keeping more symbols than gold or bfd.
>

That is a debug build. I haven't tried discard_locals yet,

Have you tried just not calling StrTabBuilder.finalize() similar to
> what we do for SHF_STRINGS sections when not optimizing? That way we
> would have fast linking at -O0 and smaller tables at -O2.
>

and neither StrTabBuilder.finalize(). But I don't want to use
StrTabBuilder.finalize() because the API has the problem as I described in
this patch. Look for "Why two phases?" and read the comment. Also, I think
StringTableBuilder is slower than this implementation even if we don't call
finalize() because StringTableBuilder copies strings, while this
implementation does not (it keeps only StringRefs).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160115/abc810ba/attachment.html>


More information about the llvm-commits mailing list