What makes a difference in the resulting compiler's speed when building gcc?

Sven C. Dack sven.c.dack@sky.com
Thu Oct 27 15:53:00 GMT 2016


Hello,

I've been installing private copies of gcc for a while now, but only recently 
did I notice that my distro's gcc (Debian testing) is doing much better when 
comparing compile times than any of my copies. For instance does it take 230s 
for my copy to compile a linux kernel, but only 163s for my distro's gcc, which 
is almost a minute in difference for something that doesn't take more than 3-4 
minutes to compile.

What makes this noteworthy for me is that I've compiled my copy with 
profiledbootstrap and LTO enabled and also optimized it for my CPU, whereas the 
distro's compiler won't have been optimized quite that much, but yet is it so 
much faster in speed. I don't know how exactly my distro's gcc has been set up, 
because the Debian build rules are rather complex and include their own set of 
patches. So I thought I start with asking here first.

What is that can make such a huge difference in compile speed for two copies of 
gcc, both version 6.2, using the same options, on the same source? Or are any of 
the configure options know to have a huge impact on the resulting compiler's speed?

Sven



More information about the Gcc-help mailing list