Commit 06b18e4b authored by Takuto Ikuta's avatar Takuto Ikuta Committed by LUCI CQ

autoninja: increase parallelism for non-HT cpu

M1 mac seems to have capacity to build with higher parallelism.
This also remove limit in macOS.

Bug: 1317620
Change-Id: I4460915c405cbb27ed977dcee631adb8753f2335
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3596361
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: 's avatarJunji Watanabe <jwata@google.com>
Reviewed-by: 's avatarFumitoshi Ukai <ukai@google.com>
Reviewed-by: 's avatarPhilipp Wollermann <philwo@google.com>
Reviewed-by: 's avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 87172073
......@@ -163,16 +163,20 @@ num_cores = multiprocessing.cpu_count()
if not j_specified and not t_specified:
if use_goma or use_remoteexec:
args.append('-j')
core_multiplier = int(os.environ.get('NINJA_CORE_MULTIPLIER', '40'))
default_core_multiplier = 80
if platform.machine() in ('x86_64', 'AMD64'):
# Assume simultaneous multithreading and therefore half as many cores as
# logical processors.
num_cores //= 2
core_multiplier = int(
os.environ.get('NINJA_CORE_MULTIPLIER', default_core_multiplier))
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)
elif sys.platform == 'darwin':
# On Mac, j value higher than 500 causes 'Too many open files' error
# (crbug.com/936864).
j_value = min(j_value, 500)
args.append('%d' % j_value)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment