From 5b935aee594dd8a694b9e6421dcc69152375fe1c Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 8 Apr 2015 13:37:57 +0900 Subject: [PATCH] Only serialize GWT opt and dbg builds on systems with less than 8 CPUs In change Icc1856c9 the compilation of the GWT opt and dbg components was serialized to reduce the load on systems that have few CPU cores. This has the side effect of extending the build time for systems that have more cores. Modify it to only serialize the compilations when the host system has fewer than 8 CPUS. On my Linux desktop with 8 CPU cores, this reduces the build time by around 50 seconds. Change-Id: I845dbfcc010c191c9a9fc42519235e1c8e329f51 --- gerrit-gwtui/BUCK | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK index aad5e0b5fd..9eb0bf6cd5 100644 --- a/gerrit-gwtui/BUCK +++ b/gerrit-gwtui/BUCK @@ -2,6 +2,7 @@ include_defs('//gerrit-gwtui/gwt.defs') include_defs('//tools/gwt-constants.defs') from multiprocessing import cpu_count +CPU_COUNT = cpu_count() DEPS = GWT_COMMON_DEPS + [ '//gerrit-gwtexpui:CSS', '//lib:gwtjsonrpc', @@ -29,8 +30,8 @@ gwt_binary( name = 'ui_opt', modules = [MODULE], module_deps = [':ui_module'], - deps = DEPS + [':ui_dbg'], - local_workers = cpu_count(), + deps = DEPS + ([':ui_dbg'] if CPU_COUNT < 8 else []), + local_workers = CPU_COUNT, strict = True, experimental_args = GWT_COMPILER_ARGS, vm_args = GWT_JVM_ARGS, @@ -41,7 +42,7 @@ gwt_binary( modules = [MODULE], module_deps = [':ui_module'], deps = DEPS + [':ui_dbg'], - local_workers = cpu_count(), + local_workers = CPU_COUNT, strict = True, experimental_args = GWT_COMPILER_ARGS + ['-compileReport'], vm_args = GWT_JVM_ARGS, @@ -54,7 +55,7 @@ gwt_binary( optimize = 0, module_deps = [':ui_module'], deps = DEPS, - local_workers = cpu_count(), + local_workers = CPU_COUNT, strict = True, experimental_args = GWT_COMPILER_ARGS, vm_args = GWT_JVM_ARGS,