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

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


On 27/10/16 17:30, Marc Glisse wrote:
> On Thu, 27 Oct 2016, Sven C. Dack wrote:
>
>> 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?
>
> --enable-checking=release would be the first thing to check.
>
Thank you, will do.

I can already say that I am using "yes", because I'm using the latest git
versions and have always favoured a reasonable amount of checks. If this is
already the cause for the difference then I might actually keep it this way.



More information about the Gcc-help mailing list