-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
build: speed up compilation of some V8 files #52083
Conversation
This introduces a special target to compile some of the 'v8_initializers' files with "-O1" instead of "-O3" to avoid huge compilation times with GCC versions <13. Closes: nodejs#52068
Review requested:
|
@targos You went with |
@lemire Yes. I tested |
@targos In the diff, I don't see GCC version detection... it says that the issue is fixed with GCC 13. Is there the equivalent of "if GCC >= 13 do this, else do that", or is that something that must be done manually later? |
@lemire I don't know, and I'm not interested in looking into it. |
Here is my proposal: we merge this PR but we add an issue where we saw that this workaround should be revisited once GCC >= 13 can be safely assumed. My concern here is that we might be trading off performance, but in a way that is non-obvious. |
If -O2 doesn't make it faster, does -Os make a difference? It would be useful to measure if this affects wasm <-> JS interop performance. For example, a benchmark involving |
Actually I think there already is a benchmark for wasm/js interop via the cjs exports detction. Benchmark CI https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1496/ |
|
For posterity:
Vs. a 200x speedup in compile times? Done, |
How much difference does -Os make in the binary size? I am not able to find where the object files are locally, the two generated .cc files appear to be around 400KB. While that’s not too big as far as generated file goes, not sure if the problematic path in GCC can lead to any surprising results here. I’d say if the binary size differences is >5m, then -Os would be better. (2m doesn’t seem that bad for V8). Otherwise -O1 is fine. |
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.
I think that this is fine as-is.
With
With
|
This introduces a special target to compile some of the 'v8_initializers' files with "-O1" instead of "-O3" to avoid huge compilation times with GCC versions <13. PR-URL: #52083 Fixes: #52068 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Lemire <[email protected]>
Landed in 4e278f0 |
This introduces a special target to compile some of the 'v8_initializers' files with "-O1" instead of "-O3" to avoid huge compilation times with GCC versions <13. PR-URL: nodejs#52083 Fixes: nodejs#52068 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Lemire <[email protected]>
This introduces a special target to compile some of the
'v8_initializers' files with "-O1" instead of "-O3" to avoid huge
compilation times with GCC versions <13.
Closes: #52068