autoninja: don't set -l.

autoninja automatically sets -l <num_cores>.  -l option makes ninja
not invoke a new command if current CPU load average is above -l.

However, as far as I investigated, -l <num_cores> make the build
much slower than without -l especially on Linux & OSX machines with
small numbers of cores.  I should say -l decreases the build
performance.  When I build Chromium with Goma with the same -j with
autoninja without -l, the load average goes more than the number of
cores while keeping the machine working as usual.
Also, ninja can invoke commands until the spike of command invocation
is reflected to load average, -l might not mitigate for a machine
to get stuck by too high load.

Note that from what I understand from the implementation, Windows
ninja's posix-compatible load average is always less than num_cores.
i.e. -l <num_cores> won't limit the process invocation.
5984986459/src/util.cc (L479)

Let me make autoninja not set -l and bring better build performance
on machines with small number of cores.

Bug: b/117810340
Change-Id: I50f231f1a8976f8ecfc3a0c778f0f1ac98d3827f
Reviewed-on: https://chromium-review.googlesource.com/c/1290611
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
changes/11/1290611/6
Yoshisato Yanagisawa 7 years ago committed by Commit Bot
parent 861640f6c8
commit 0db62fcf9c

@ -15,7 +15,7 @@ import os
import re
import sys
# The -t tools are incompatible with -j and -l
# The -t tools are incompatible with -j
t_specified = False
j_specified = False
output_dir = '.'
@ -81,12 +81,4 @@ if not j_specified and not t_specified:
args.append('-j')
args.append('%d' % (num_cores + core_addition))
if not t_specified:
# Specify a maximum CPU load so that running builds in two different command
# prompts won't overload the system too much. This is not reliable enough to
# be used to auto-adjust between goma/non-goma loads, but it is a nice
# fallback load balancer.
args.append('-l')
args.append('%d' % num_cores)
print ' '.join(args)

Loading…
Cancel
Save