-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Enable REVERSE_DEPS=all on O0/O1 #13510
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
Comments
I took a quick look at doing this when I originally added REVERSE_DEPS. I was a little concerned by one thing which was that |
It looks like How much of a speedup do large projects get at link time with this? Is it significant after the recent |
I'm saving 25% or 5.5s on a 21s link with that option. |
@pfaffe , is that even after that last optimization I linked to? (it landed 3 days ago) |
From looking at #13465 it looks like it might not be great for apps that have a lot of |
@kripken it's with 2.0.14, did that change make it in? |
@pfaffe do you see a single |
I see a lots of them in the profile, each not terribly expensive. |
I'm confused as to why you'd see more than one. @sbc100 the cause appears to be this code in # Any .a files that have multiple .o files will have hard time parsing. Scan those
# sequentially to confirm. TODO: Move this to use run_multiple_processes()
# when available.
for f in files:
if f not in nm_cache:
nm_cache[f] = llvm_nm(f) I'm unsure why we need those extra calls? |
I looks like that recent change combines calls to We could probably refactor such that all libraryies and object can be processed in one go? @juj worked on this most recently so is probably best places to know. |
@kripken Did you measure the impact on non-trivial projects as well? |
@pfaffe now that you have this option presumably you can add it to your project and this makes this change less urgent. I'm hoping there may be ways we can reduce the impact on small projects before we decide to move forward. |
The impact on small projects seems negligible. A constant worst-case overhead of 30k/250k isn't a lot, in particular when the optimizer happily removes it. I expect people who care about the size to run at higher opt levels anyways, so they're not affected. It would be great to get more data on projects that aren't tiny. What's the worst case and average overhead on the emscripten test-suite? |
Testing on Binaryen, which is larger than almost everything in the emscripten test suite, Testing compile times, Overall I can't see a strong reason against enabling However, there may be some downside I am missing. It would be even safer to do this if we had a solution to the bulk of the increase, which is from |
OK, given your research there it does seem reasonable to move forward with this change. I'd still love to see the emscripten_GetProcAddress problem addressed. |
#13524 helps with GetProcAddress. In general I think that moving more code from JS to C can remove the need for deps_info entries. |
What is the remaining overhead of |
With that PR? Still quite large, because there are a few other big methods in deps_info. |
We should at least land #13524 before we do this. |
This avoids having them on the right-hand-side in deps_info, which means that in REVERSE_DEPS=all mode we do not include that function and all the GL code it calls. Instead, the callers are just more C functions that the linker does the right thing. Helps #13510
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Now that we have a REVERSE_DEPS setting, can we make
all
the default on O0 and O1 builds? Theall
setting matches the expectation of "fast builds, suboptimal binaries" of the O0/O1 optimizer levels.The text was updated successfully, but these errors were encountered: