From 0db62fcf9c7e559f30b81073868f1a6d78a7f94a Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Thu, 1 Nov 2018 01:09:53 +0000 Subject: [PATCH] autoninja: don't set -l. autoninja automatically sets -l . -l option makes ninja not invoke a new command if current CPU load average is above -l. However, as far as I investigated, -l 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 won't limit the process invocation. https://github.com/ninja-build/ninja/blob/59849864592b421e0a8f993011e7e5c2ab27e77b/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 Reviewed-by: Bruce Dawson Commit-Queue: Yoshisato Yanagisawa --- autoninja.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/autoninja.py b/autoninja.py index c3759e278..2c1cc9b7b 100755 --- a/autoninja.py +++ b/autoninja.py @@ -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)