Remove /MP from default additonal options#22661
Remove /MP from default additonal options#22661skelliam wants to merge 3 commits intonodejs:masterfrom
Conversation
|
@nodejs/platform-windows @nodejs/node-gyp |
|
/CC @nodejs/build-files This makes sense to me. It's a low value optimization, and if it has negative effects (re |
|
There is one more instance; can I add on to this commit? |
|
Will this make building Node.js itself even slower on Windows? |
|
@tniessen , if you look at the comment in nodejs/node-gyp#1087, it appears that Ninja already handles parallelization, and in fact it looks like there is some effort filter /MP out anyway. |
|
cc @seishun who worked on this flag before. |
|
Here is the documentation from MSDN regarding |
|
FYI: GYP allows for removing items from list with the {
'targets': [
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ],
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions!': [
'/MP'
]
}
}
}
]
} |
Highly unlikely, since even when you use Lines 300 to 305 in 9f7efd5 P.S. |
|
Thanks @refack; was looking all over for a solution to this, sounds like your proposal would have worked. I did try to set the contents of |
BTW for that GYP has the 'msvs_settings': { 'VCCLCompilerTool': {
'AdditionalOptions=': []
} } |
Building Node.js on Windows is not as slow as it used to be. There were recent improvements. |
|
I'm -1. On my box this increases clean build time from 9 min 22 sec to 14 min 21 sec. |
|
Longer term the better solution is probably to implement nodejs/node-gyp#1118 and stop |
joaocgreis
left a comment
There was a problem hiding this comment.
This will make compiling core much slower. I see CI hasn't yet been run for this PR, but it should be very noticeable there. If there's a way to make /MP active only for node core then this might be worth considering.
|
Can't you still have /MP with the XML option "MultiProcessorCompilation" in msvs_settings? This way the user override is at least more intuitive (IMO). Otherwise I like the idea from #1118. |
I did: Line 300 in 9f7efd5 |
I think that makes sense. |
this will replace the hardcoded /MP with an implicit /MP that is easier for users to override.
|
Added 'MultiProcessorCompilation': 'true' (implicit /MP) instead of the hardcoded /MP. Users can override this with 'MultiProcessorCompilation': 'false' in their own binding.gyp. |
refack
left a comment
There was a problem hiding this comment.
💯 Since this is essentially a no-op.
richardlau
left a comment
There was a problem hiding this comment.
Approving the change from /MP to 'MultiProcessorCompilation': 'true' provided build times remain unchanged.
|
The compilation time on Windows did not increase after the latest CI run. |
|
Landed in 56d9cd4. |
PR-URL: #22661 Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
PR-URL: #22661 Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Forcing this option means that the user-provided option
MultiProcessorCompilationinmsvs_settings(from, for example, binding.gyp) is useless. It also means that one cannot use#importin their source code or they will be faced with this error when trying to build:Please see additional discussion of this here: nodejs/node-gyp#1087
and here: nodejs/node-gyp#26