[autoninja] change default -j multiplier 20 -> 40
I compared build time of chrome on some platforms without goma backend cache case.
* 4C/8T MacBook Pro
x20: 1900s
x40: 1357s
* 24C/48T Z840 Windows 10:
x20: 747s
x40: 733s
* 24C/48T Z840 Linux:
x20: 267s
x40: 189s
Change-Id: Iaa4c1e770ffcbc3f7d355060d0df03bf3f3b344f
Reviewed-on: https://chromium-review.googlesource.com/c/1457037
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Shinya Kawanaka <shinyak@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
diff --git a/autoninja.py b/autoninja.py
index 96439f8..a09e839 100755
--- a/autoninja.py
+++ b/autoninja.py
@@ -79,8 +79,14 @@
if not j_specified and not t_specified:
if use_goma:
args.append('-j')
- core_multiplier = int(os.environ.get("NINJA_CORE_MULTIPLIER", "20"))
- args.append('%d' % (num_cores * core_multiplier))
+ core_multiplier = int(os.environ.get("NINJA_CORE_MULTIPLIER", "40"))
+ j_value = num_cores * core_multiplier
+
+ if sys.platform.startswith('win'):
+ # On windows, j value higher than 1000 does not improve build performance.
+ j_value = min(j_value, 1000)
+
+ args.append('%d' % j_value)
else:
core_addition = os.environ.get("NINJA_CORE_ADDITION")
if core_addition: