System Grab Bag

View all TLDR pages from common (or from all pages)

wasm-opt

Optimize WebAssembly binary files. More information: https://github.com/webassembly/binaryen.
  • Apply default optimizations and write to a given file:
    wasm-opt -O {{input.wasm}} -o {{output.wasm}}
  • Apply all optimizations and write to a given file (takes more time, but generates optimal code):
    wasm-opt -O4 {{input.wasm}} -o {{output.wasm}}
  • Optimize a file for size:
    wasm-opt -Oz {{input.wasm}} -o {{output.wasm}}
  • Print the textual representation of the binary to console:
    wasm-opt {{input.wasm}} --print

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.