This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reduce compilation times?

J.C. Pizarro wrote:
2007/11/27, Galloth <> wrote:
* to put more machines with more cores per chip (quadcore?),
bigger caches (8 MiB L2?) and higher frequencies
Does it means that gcc can use several cores for one compilation (If
yes, how to activate this, please) or this is the same idea as using
make -j (several compilations at once)

It's the same problem of "Nine Woman Can't Have a Baby in One Month"

"Nine Cores Can't Reduce a Compilation of 9 Seconds to One Second"

I believe that it's possible to reduce it but it's very hardful.

This is why you should re-factor your code as to contain only one [or as few as possible] exportable functions per unit.

If you write an entire 100K line program as "main.c" of course you'll be hit by slow compiles.

But if you factor the code you can get good savings. For instance, one of my OSS projects (if you know who I am you know what I'm talking about) is ~50K lines and compiles in ~29 seconds on a pentium 4. It builds in 8 seconds a quad-core Intel Core2. For most files [units] I only have one function, so the line count per file is on average ~200 or so.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]