-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Extremely long link time #23034
Comments
It seems like there are some default LTO optimization enabled for wasm-ld, which can be overridden with
The final link stage now takes a lot less, which is useful for quick debug iterations:
|
So it looks like most all of the time is LTO? And it looks like you have found LTO flags to control how LTO runs, but you could also completely avoid LTO in your debug builds if you want the fastest possible link time (i.e. compile your object files without |
An in-depth inspection revealed that one of the dependencies was mistakenly built with These are the final binrayen flags for the debug build now: If there is nothing else that can be done regarding speeding up the link time, you can close this issue.
|
That last binaryen command is printing out the symbol map (list of function names), for which it reads the wasm. For a very large wasm file, taking a few seconds is normal there. (If this is a smaller file then maybe something odd is happening, and if you provide the file I can profile it.) You can skip that stage by not providing |
This is quite large file (1.5GB) because we don't run any optimizations for the debug build. Therefore we need to run emstrip to reduce the size of the final binary and we need the Sadly I cannot share the wasm file itself due to the legal requirements. |
After profiling, the most time-consuming par of the |
Running on version 3.1.60
We have a quite large repository that we build using Emscripten. The link time became quite time-consuming (~2min on Intel i7 12700F), which is unusually long since lld (and its port wasm-ld) should be very fast and typically not the bottleneck in the build process.
We went through the following issue #17019 and applied both flags
-sERROR_ON_WASM_CHANGES_AFTER_LINK -sWASM_BIGINT
. We build/link with-Og
.This is the
EMPROFILE=2
verbose output for the final link stage:These are our build flags:
Is there anything that you suggest can be done in order to decrease the link time?
The text was updated successfully, but these errors were encountered: