Re: reduce compilation times?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



J.C. Pizarro wrote:
2007/11/27, Galloth <lordgalloth@xxxxxxxxx> 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.

Tom

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux