[nycbug-talk] Re: talk Digest, Vol 14, Issue 9

Bob Ippolito bob
Thu Jan 13 20:02:42 EST 2005

On Jan 13, 2005, at 19:45, Pete Wright wrote:

>>> # make -j5 buildworld KERNCONF=MY_KERNEL
>>> this will launch 5 make jobs, which will speed up some of the make
>>> tasks.
>> Typically it's recommended to use -jN where N is the number of
>> processors you actually have.  For values of N greater than the number
>> of CPUs you have, it should actually go slower...  I would think that
>> -j5 is slower than -j4 on a dual CPU system (though -j3 or -j4 might 
>> be
>> a little faster than -j2 for some kinds of source, -j2 is always 
>> faster
>> than -j1 on a dual processor system).
> Just to prove that I'm not pulling this outta my a*s.  From the 
> handbook
> (granted it's from make buildworld...altho I've found this to work 
> fine on
> kernels for a long time now):
> "It is now possible to specify a -j option to make which will cause it 
> to
> spawn several simultaneous processes. This is most useful on multi-CPU
> machines. However, since much of the compiling process is IO bound 
> rather
> than CPU bound it is also useful on single CPU machines.
> On a typical single-CPU machine you would run:
> # make -j4 buildworld
> make(1) will then have up to 4 processes running at any one time.
> Empirical evidence posted to the mailing lists shows this generally 
> gives
> the best performance benefit.
> If you have a multi-CPU machine and you are using an SMP configured 
> kernel
> try values between 6 and 10 and see how they speed things up.
> Be aware that this is still somewhat experimental, and commits to the
> source tree may occasionally break this feature. If the world fails to
> compile using this parameter try again without it before you report any
> problems."

Ok, I said "some kinds of source" for that reason.  It really depends 
(but it's universally true that N should be *at least* the number of 
CPUs you have).  In this case, they've tried it, and large numbers are 
good.  When I've tried -jN, I usually find that the optimal numbers 
aren't that large, but I'm compiling different things..


More information about the talk mailing list