[patch] Merge identical strings

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 12:55:17 PST 2016


LGTM with a few nits. I uploaded it to http://reviews.llvm.org/D16690 for
me. Can you address the comments I left there?

As to speed, that numbers are fantastic. I originally thought 4% might be
too large, but if it is 0.58% or 0.1%, it's no brainer. And it is
interesting that you got the exact same strtab sizes, because it means that
there are absolutely no global or local symbols sharing the same even in
fairly large programs.

On Thu, Jan 28, 2016 at 8:45 AM, Rafael EspĂ­ndola <
llvm-commits at lists.llvm.org> wrote:

> >> When linking clang on a Opteron this goes from 1.090608063 to
> >> 1.135082244 seconds (1.04X slower)
> >>
> >> and strtab goes from 5426172 to 5319595 bytes (1.02X smaller).
> >>
> >> Linking scylladb goes from 8.104377098 to 8.116767958 (1.0015X slower)
> >> and the strtab goes from 14824893 to 14443221 (1.026X smaller).
> >>
> >
> > The savings are relatively small, but still greater than zero. For a
> > small increase in cost, at least for scylladb.
> > For clang the link time increases a little bit more but I still feel
> > that tolerable. We can always re-evaluate this in the future if it
> > shows up being a problem.
>
> Yesterday Rui remarked that global symbol names are already uniqued in
> the symbol table. I first thought about reusing the hash, but then
> decided to try something even simpler: don't unique strings from the
> symbol table. This means we would duplicate a string if a local symbol
> has the same name as a global, but merge other cases.
>
> In both clang and scylladb I get the same exact same strtab sizes
> (1.02X smaller and 1.026X smaller), but now the slowdowns are just
> 1.0058X and 1.00106X.
>
> Cheers,
> Rafael
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160128/90fdc4aa/attachment.html>


More information about the llvm-commits mailing list