浏览代码

wasm-opt: add page (#2383)

Agniva De Sarker 6 年之前
父节点
当前提交
ffd0b4bee4
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      pages/common/wasm-opt.md

+ 19 - 0
pages/common/wasm-opt.md

@@ -0,0 +1,19 @@
+# wasm-opt
+
+> Optimize WebAssembly binary files.
+
+- 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`