On 2013.03.25 at 08:06 +0100, Markus Trippelsdorf wrote: > On 2013.03.24 at 20:53 +0100, gcc_mailingl...@abwesend.de wrote: > > > > is it useful to compile gcc 4.8.0 with the lto option? > > If you want a (slightly) faster compiler then yes. > Simply add "--with-build-config=bootstrap-lto" to your configuration. > You can combine this with profile feedback: "make profiledbootstrap".
To qualify "(slightly) faster" in the statement above, I build gcc with four different configurations on my AMD64 4-core machine (vanilla, LTO only, PGO only, LTO+PGO). Then I measured how much time it takes to build the Linux kernel and Firefox. Here are the results: Firefox: vanilla: 5143.27s user 267.27s system 346% cpu 26:02.03 total PGO : 4590.37s user 270.21s system 344% cpu 23:28.89 total LTO : 5056.11s user 268.04s system 348% cpu 25:28.73 total LTO+PGO: 4598.79s user 269.01s system 347% cpu 23:22.13 total kernel (measured three times): vanilla: 382.34s user 23.74s system 334% cpu 2:01.41 total 382.08s user 24.05s system 333% cpu 2:01.93 total 385.20s user 23.63s system 330% cpu 2:03.73 total PGO : 341.18s user 23.25s system 323% cpu 1:52.71 total 341.72s user 23.66s system 323% cpu 1:52.93 total 340.32s user 23.42s system 326% cpu 1:51.38 total LTO : 381.23s user 23.55s system 328% cpu 2:03.05 total 380.41s user 24.35s system 328% cpu 2:03.24 total 379.47s user 23.98s system 331% cpu 2:01.82 total LTO+PGO: 347.12s user 25.11s system 317% cpu 1:57.34 total 344.38s user 24.05s system 326% cpu 1:52.99 total 344.74s user 24.61s system 323% cpu 1:54.03 total To summarize: * GCC build with PGO is ~10% faster than a vanilla bootstrapped compiler. * GCC build with LTO only is only ~2% faster when building Firefox. The kernel build time difference is in the noise. * A LTO+PGO build is almost exactly as fast as a pure PGO build. So it appears, contrary to the advice given above, that it is not useful to build gcc 4.8.0 with the lto option at the moment. -- Markus