From 6dd0f756f2272b27cf1652d2b844a92babcc785a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Tue, 4 Apr 2017 21:01:24 +0100 Subject: [PATCH 1/2] build,win: limit maxcpucount to 2 for MSBuild MSBuild invokes cl.exe with /MP (set in common.gypi), making it compile sources in parallel using a number of internal processes equal to the number of effective processors. MSBuild /m uses a similar mechanism, so the number of compiler processes can grow to the number of effective processors squared. This limits MSBuild to 2 processes, to still use some parallelization while requiring less memory. Cl.exe is still invoked with /MP, thus the maximum number of processes is limited to twice the number of effective processors. PR-URL: https://github.com/nodejs/node/pull/12184 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis --- vcbuild.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index 985b7f1fccd791..98260a9db00537 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -190,9 +190,11 @@ echo Project files generated. if defined nobuild goto sign @rem Build the sln with msbuild. +set "msbcpu=/m:2" +if "%NUMBER_OF_PROCESSORS%"=="1" set "msbcpu=/m:1" set "msbplatform=Win32" if "%target_arch%"=="x64" set "msbplatform=x64" -msbuild node.sln /m /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if "%target%" == "Clean" goto exit From d50bb932f6f2faefd01504e5d6b6b871a917d9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Mon, 3 Apr 2017 01:24:53 +0100 Subject: [PATCH 2/2] deps,win: increase msvs_shard in gyp for V8 Increase the number of shards to divide v8_base into. This increases the number of calls to cl.exe but decreases the number of files compiled each time. Fixes: https://github.com/nodejs/v8/issues/4 PR-URL: https://github.com/nodejs/node/pull/12184 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis --- deps/v8/src/v8.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/v8/src/v8.gyp b/deps/v8/src/v8.gyp index 6b94e21b38ca47..f3fb248c29ddff 100644 --- a/deps/v8/src/v8.gyp +++ b/deps/v8/src/v8.gyp @@ -1741,7 +1741,7 @@ # When building Official, the .lib is too large and exceeds the 2G # limit. This breaks it into multiple pieces to avoid the limit. # See http://crbug.com/485155. - 'msvs_shard': 4, + 'msvs_shard': 10, }], ['component=="shared_library"', { 'defines': [