Quote:
Originally Posted by pan64
Actually this calculation is not correct. Assuming we have n cores (n > 2) we can do the following:
subtract 1 for the system, 1 for all the user processes together like X, IDE, browsers and others and safely multiply by two the number of remaining cores. This will give you approximately the number of parallel builds (the number to -j flag). You can even use that number as a lower limit and you can increase it, but usually higher values will not give you faster builds - but also it will not slow down anything, therefore it is safe (up to a reasonable limit).
|
couple things
the kernel is threaded by design
if there are 2 processes running on one core, bout will get 50% of it
CFS group scheduling patch that landed a while ago treats a group of processes as one process
so even if you put -j100 the desktop will be responsive (provided you have enough memory to do that)
also there is nice
but yes, putting more then you have cores gives usually no gain
if i remember good, ncores+1 gave me 1% faster compile then ncores