-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove /MP from default additonal options #22661
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 was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 if it slows down compilation as @bzoz described.
Longer term the better solution is probably to implement nodejs/node-gyp#1118 and stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 Since this is essentially a no-op.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
MultiProcessorCompilation
inmsvs_settings
(from, for example, binding.gyp) is useless. It also means that one cannot use#import
in 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