juggernaut icon indicating copy to clipboard operation
juggernaut copied to clipboard

Wasm in demo page is unoptimized

Open kripken opened this issue 6 years ago • 0 comments

Running wasm-opt -O on it, it becomes less than half the size, 723,715 bytes instead of 1,576,113.

This may not just affect size, as wasm-opt --metrics -O --metrics reports this in the diff:

 [vars]         : 10448     -79887

which means the number of local variables goes from 90335 to 10448, almost 9x less. Wasm VMs may not be able to run unoptimized code with excessively many locals at full speed (they may end up stuck in baseline tiers).

(Aside from the Binaryen optimizer, LLVM opts should also be run, but I can't tell if they were or not from the binary.)

kripken avatar Jul 04 '19 20:07 kripken