Skip to content
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

Support to link all wasm modules to a single .wasm (exe) file #16107

Open
dumganhar opened this issue Aug 25, 2023 · 2 comments
Open

Support to link all wasm modules to a single .wasm (exe) file #16107

dumganhar opened this issue Aug 25, 2023 · 2 comments
Assignees
Milestone

Comments

@dumganhar
Copy link
Contributor

dumganhar commented Aug 25, 2023

Some References:

https://pspdfkit.com/blog/2022/dynamic-linking-in-webassembly/

https://qa.fmod.com/t/linking-fmodstudio-bc-to-emscripten-build/15392/7

In October of 2019 the emscripten SDK deprecated the “fastcomp” build process, which built all WebAssembly code as LLVM intermediate bit code (.bc files) and the linking/final processes converted the desired LLVM bit code into 32-bit WebAssembly byte code. All emscripten releases from 1.39 onward now use the “upstream” build process, where the clang compiler and LLVM tools all work with WebAssembly byte code directory.

https://emscripten.org/docs/compiling/WebAssembly.html#backends

@dumganhar dumganhar added this to the V3.9.0 milestone Aug 25, 2023
@dumganhar dumganhar self-assigned this Aug 25, 2023
@dumganhar dumganhar moved this from Todo to In Progress in PAL & Infrastructure Sep 8, 2023
@dumganhar
Copy link
Contributor Author

dumganhar commented Sep 11, 2023

  • Put Spine wasm and physX wasm together ( the whole package size could reduces 80 KB )
  • Put Box2D, Spine, physX wasm together( the whole package size could reduces (3500761 - 3317999 = 182KB)

EMSDK 3.1.41

Original Size:

  • spine.wasm: 449470
  • spine.wasm.js: 55547
  • box2d.release.wasm.wasm: 183535
  • box2d.release.wasm.js: 62299
  • physx.release.wasm.js: 63643
  • physx.release.wasm.wasm: 2686267

Fat wasm size:
spine+physX.wasm: 3103482
spine+physX.wasm.js: 65703
spine+physX+box2d.wasm: 3252061
spine+physX+box2d.wasm.js: 65938

@dumganhar
Copy link
Contributor Author

Moved to sprint 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant