On 11/27/12 2:55 PM, Chris Peterson wrote:
On 11/27/12 2:35 PM, Gregory Szorc wrote:
I feel the build system should be as fast as possible by default - no
user action necessary. If you find that -j == # cores isn't providing
the fastest builds possible, please present your data and we'll change
the default value.
A gnumake flag that obsessive mozconfig tweakers may want to test is
--load-average (-l).
You can specify a maximum load average to throttle the number of make -j
jobs that are running simultaneously. You can specify a high -j to have
many jobs available (e.g. 2 * # cores), but never run more than -l # cores.
https://www.gnu.org/software/make/manual/make.html#Parallel
If anyone has data showing -l to behave better than -j, I will happily
incorporate it into the build system.
That being said, I don't think using this flag is a good idea.
Due to the way parts of the build system work, there will be many active
processes contributing to the load average that don't contribute much
CPU (the build is mostly CPU bound). If you throttle based on load
average and you set the limit too low, you won't use all available CPU
cycles. If you set the load limit too high, you will cause unnecessary
context switching and memory pressure, slowing the build (and your
system) down.
Essentially, since we are mostly CPU bound, -j is already a decent
approximation of what the system is capable of. Due to the way load
average is calculated, I just don't think it is the proper way to
throttle a CPU bound process.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform