-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Large filesize (1MB of raw WASM) #269
Comments
Making this change -wasm-opt = ['-O4', '--dce']
+wasm-opt = ['-g'] takes the filesize from
I'm not familiar with these tools, but it looks like there's no giant blob of some dependency getting smashed in. Seems like this is just how much it takes. FWIW, matter.js seems to be ~120kB. |
I'm not too familiar with codesize optimizations, but that's a valuable topic for sure! I see a few serde items on the larger items, I'm curious how the filesize changes when the serialize feature is disabled 🤔. Also, from guidelines at https://rustwasm.github.io/book/reference/code-size.html#use-trait-objects-instead-of-generic-type-parameters ; heavy generic-based codebase tends to generate a lot of code (due to monomorphization), and rapier heavily uses those. It might be interesting to parse somehow the top dependencies rather than the top functions 🤔 |
I'm currently trying to implement Rapier on CloudFlare Workers, but they have a 1MB limit on code size and version |
Has any effort gone into filesize? Maybe there are some low hanging fruit?
@dimforge/rapier2d 0.12.0
, the filerapier_wasm2d_bg.wasm
is1.05MB
0.11.2
is1.05MB
0.11.0
is1.04MB
0.10.0
is1.04MB
0.9.0
is1.02MB
So there's no sudden jump, seems like it's always been very large.
The text was updated successfully, but these errors were encountered: