Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Better yet...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Better yet...
Authored by: gospodin_david on May 03, '04 12:22:28PM

A good general way of handling this sort of thing is to take the number of processors times two and put that in the -j option.

This is because when there are two compilations per processor, one can be compiling while the other can be waiting for something from disk. Thus, with a dual-processor machine, a roughly optimal setting is "-j 4."

With larger numbers of processors, the formula doesn't work as well, but as we Mac users are limited to 2 max at the moment (please Apple, make a 2U 4-proc XServe!), it works just fine.

[ Reply to This | # ]
Better yet...
Authored by: risc_abacus on May 04, '04 10:37:24AM

Some place... don't remember where... but I read the ideal setting would be -j(n*2) where n is the number of processors...

1 CPU -> -j2
2 CPU's -> -j4
3 CPU's -> -j6 (using 'distcc' you might have this set-up, 1-Dual one Single System)
4 CPU's -> -j8
n CPU's -> -j(n*2)

[ Reply to This | # ]