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

wasm-opt flags -Os vs. -Oz #95

Open
webmaster128 opened this issue Oct 16, 2022 · 1 comment
Open

wasm-opt flags -Os vs. -Oz #95

webmaster128 opened this issue Oct 16, 2022 · 1 comment

Comments

@webmaster128
Copy link
Member

Locally I'm testing the two optimization modes with wasm-opt version 110:

$ wasm-opt --help
  …
   -Os                                          execute default optimization 
                                                passes, focusing on code size 

   -Oz                                          execute default optimization 
                                                passes, super-focusing on code 
                                                size 
  …

For my tests, there is a difference in the order of magnitute of 1-2%:

# -Os

-rwxr-xr-x  1 me  staff  192130 16 Okt 17:27 nois_demo.wasm
-rwxr-xr-x  1 me  staff  480903 16 Okt 17:27 nois_oracle.wasm
-rwxr-xr-x  1 me  staff  225705 16 Okt 17:27 nois_proxy.wasm

# -Oz

-rwxr-xr-x  1 me  staff  189263 16 Okt 17:29 nois_demo.wasm
-rwxr-xr-x  1 me  staff  472586 16 Okt 17:29 nois_oracle.wasm
-rwxr-xr-x  1 me  staff  223632 16 Okt 17:29 nois_proxy.wasm

So for now I don't see a strong need to move away from the well established -Os.

@webmaster128
Copy link
Member Author

webmaster128 commented Jan 30, 2024

Some more example numbers from https://twitter.com/const_amit/status/1752210883156062660:
GFEaE-1WYAASkrh

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

No branches or pull requests

1 participant