How many jobs should i start when using make?
I wonder what number of jobs would be the most effective one when i run 开发者_如何学编程'make -j x'. Is it the number of cores or would it be better to use even more jobs?
A good value is number of CPUs + 1
.
So if you have a recent quadcore CPU which has hyperthreading, use 9. If you have a dualcore without hyperthreading, use 3.
I've seen recommendations for -j(2N+1)
where N
is the number of cores. I have no idea where the number came from, sorry.
I have a 3rd Generation Intel Core i7 (quad-core) on my laptop.
I realized that make -j5
does not take advantage of all the parallelism the i7 can offer.
make -j9
, however, does not go 100% cpu usage either while compiling most packages. Compiling the GNU kernel is way faster here (and uses 100% cpu) if I do something bigger than 10, like make -j18
or something.
I guess it's trial and error.
精彩评论