[PATCH] D92844: [gn build] Link with -Wl,--gdb-index

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 11:38:23 PST 2020


thakis added a comment.

>> Do you think we should have some mode to get `-g1` for that use case? I'd expect that to make your use case link faster than it currently does. (At least while we don't use fission, but even then it'll reduce .o file size which likely means faster build time with distributed compiles.) And then we could do the index only on `-g` not `-g1` builds.
>
> Oh yes that would be ideal.

I rebased this across your CL (not yet uploaded) and measured --gdb-index impact for -g1:

      N           Min           Max        Median           Avg        Stddev
  x   5    0.91551208     1.0278211    0.99482608    0.98919582    0.04413594
  +   5     1.0646391      1.082478     1.0822251      1.076741   0.008073845
  Difference at 95.0% confidence
  	0.0875452 +/- 0.0462716
  	8.85014% +/- 4.6777%
  	(Student's t, pooled s = 0.0317267)

So with `-g1` it still makes likes ~9% slower, but the absolute time difference for lld is < 0.1s, instead of 0.5s for -g2. (Load time in gdb in both cases is < 1s, with and without index. With index feels maybe a bit faster, but it's fast enough anyways that it isn't a dramatic benefit.) Do you have an opinion on if we should pass this for g1 too? Benefit is a slightly more regular build configuration, drawback is very slightly slower links. Let me know what you prefer :)


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

https://reviews.llvm.org/D92844



More information about the llvm-commits mailing list