-
Notifications
You must be signed in to change notification settings - Fork 1.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
[dart2wasm] Compiling acx results in massive duplication of imports #60384
Comments
I think I found the issue but run out of time before fixing it. The transformer that transforms interop functions creates specializers for members here: sdk/pkg/dart2wasm/lib/js/interop_specializer.dart Lines 369 to 387 in 2cbdfaa
These specializer are created per invocation (the sdk/pkg/dart2wasm/lib/js/interop_transformer.dart Lines 75 to 91 in 2cbdfaa
So if I see invocation of a Each of these specializers creates an import: sdk/pkg/dart2wasm/lib/js/interop_specializer.dart Lines 81 to 106 in 2cbdfaa
The sdk/pkg/dart2wasm/lib/js/method_collector.dart Lines 37 to 39 in 2cbdfaa
But we create a procedure for each specializer, so we still create a procedure for each use site. I think this cache is never hit currently. I think we need to be caching the specializers, there should be one per called procedure. I'll try to fix this tomorrow. |
When compiling ACX gallery it seems to result in massive duplication of imports. What I see is
The
acx.mjs
file has manysimilarly the wasm file has corresponding imports
It's not very clear why this is the case, the source code only contains one function
It's almost as every call site to
setAttribute
will get it's own entry in the mjs file and corresponding wasm import.Though this is bad for code size, startup and performance (as JS would need to compile all of those closures - even though they perform the same work)
/cc @srujzs @osa1
The text was updated successfully, but these errors were encountered: