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

Opt physX wasm lib size. #2

Open
GuoLei1990 opened this issue Jul 8, 2021 · 2 comments
Open

Opt physX wasm lib size. #2

GuoLei1990 opened this issue Jul 8, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@GuoLei1990
Copy link
Member

GuoLei1990 commented Jul 8, 2021

Embind will generate JS code to import wasm binary. we can bind the API as we need to reduce wasm binary size. And the size of glue file will not change dramatically.

@GuoLei1990 GuoLei1990 added the enhancement New feature or request label Jul 8, 2021
@yangfengzzz yangfengzzz reopened this Jul 8, 2021
@yangfengzzz
Copy link
Member

Is there possible to call compiler in editor and only include necessary binding API to reduce the size of wasm binary.

@yangfengzzz
Copy link
Member

yangfengzzz commented Aug 25, 2021

// Optimize for size.
wasm-opt -Os -o output.wasm input.wasm

// Optimize aggressively for size.
wasm-opt -Oz -o output.wasm input.wasm

// Optimize for speed.
wasm-opt -O -o output.wasm input.wasm

// Optimize aggressively for speed.
wasm-opt -O3 -o output.wasm input.wasm

ref: code-size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants