walloc
walloc copied to clipboard
wasm-opt?
This is very cool!
I'm curious, does it get any smaller with wasm-opt -O2 applied?
Hey @sbc100, tx for kind words :)
Good question! Here's some tests. test.wasm is the "stock" walloc as built by "make test" with clang from mid-september, built with -Oz. The different optimization levels below are the levels passed to walloc-opt.
-rw-rw-r-- 1 wingo wingo 1810 Oct 19 10:10 test-O0.wasm
-rw-rw-r-- 1 wingo wingo 1681 Oct 19 10:10 test-O1.wasm
-rw-rw-r-- 1 wingo wingo 1660 Oct 19 10:10 test-O2.wasm
-rw-rw-r-- 1 wingo wingo 1648 Oct 19 10:10 test-O3.wasm
-rw-rw-r-- 1 wingo wingo 1662 Oct 19 10:10 test-O4.wasm
-rw-rw-r-- 1 wingo wingo 1647 Oct 19 10:10 test-Os.wasm
-rw-rw-r-- 1 wingo wingo 1647 Oct 19 10:10 test-O.wasm
-rw-rw-r-- 1 wingo wingo 1647 Oct 19 10:10 test-Oz.wasm
-rwxrwxr-x 1 wingo wingo 2023 Oct 13 14:36 test.wasm
So wasm-opt makes a binary that is 81% the size of the original. Not bad!