-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Split the wasm file #4555
Comments
I don't think this is possible in wasm. There's an open issue with some discussion WebAssembly/design#1166, but I can't find anything else. On other platforms you can also split the debuginfo into a separate file, but that doesn't seem possible on wasm. On a release build you can just remove the debug info instead which further cuts file size: #3978 (comment). With all the options in that comment I can go from |
Yes,But there's an other way to resolve this. We can split some standalone module, and then use webworker to post message. |
Wasm code splitting is, to the best of my knowledge, not available in Rust. And it is implemented in C++ https://github.com/WebAssembly/binaryen/blob/102c3633d2378457dae1f5e239fd63ad80eefb92/src/tools/wasm-split/wasm-split.cpp#L339 (and it is used by wasm-opt I believe) In the case of web at least, the limitation is still lazy loading the modules. https://emscripten.org/docs/optimizing/Module-Splitting.html#running-on-the-web |
See this issue where I posted a prototype that addresses exactly this: rustwasm/wasm-bindgen#3939 |
To at least get rid of the debug info, I'm using |
Bevy output wasm is big , 3d-scene wasm file was 14MB, gzip size is 3.6.
Is it possible to split a single wasm file into different modules to better utilize browser network concurrency?
The text was updated successfully, but these errors were encountered: