-
Notifications
You must be signed in to change notification settings - Fork 153
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
Avoid exponential blowup in size of Builder type #591
Avoid exponential blowup in size of Builder type #591
Conversation
See the comment added to builder.rs for the juicy details, but the tl;dr is that by *not* calling a shared internal function in the various `ElementBuilder` entrypoints, we avoid an exponential explosion in the size of the resulting Builder object type and thereby dodge limits on mangled symbol size.
18b280a
to
067f336
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #591 +/- ##
==========================================
- Coverage 60.82% 60.52% -0.30%
==========================================
Files 56 56
Lines 9340 9396 +56
==========================================
+ Hits 5681 5687 +6
- Misses 3659 3709 +50
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
Looks good. Thanks for the very detailed explanation!
This commit took our build time from 11 mins to 3.5. Appreciate it! Details
|
See the comment added to builder.rs for the juicy details, but the tl;dr is that by not calling a shared internal function in the various
ElementBuilder
entrypoints, we avoid an exponential explosion in the size of the resulting Builder object type and thereby dodge limits on mangled symbol size.An alternative solution would be recommending using
v0
name mangling (RUSTFLAGS=-Csymbol-mangling-version=v0
) but that seems less convenient for users and anyway we should probably avoid generating exponential types in case the compiler takes a peek and gets very sad and slow.This is kind of hard to add an automatic (stress) test for, as testing requires poking the generated
.wasm
file to see if any of the mangled names are looking exponential-ish.