using the compiler

Optimization

Optimization is opt-in: -O runs rasc’s own passes, -O2 adds a pass through Binaryen’s wasm-opt. The default build stays fast and reproducible.

-O: rasc’s own passes

-O2: the binaryen post-pass

-O2 is -O plus a wasm-opt round trip (-O3 -fimfs=100 -ifwl -g), discovering the binary via RASC_WASM_OPT or PATH. The post-pass is best-effort: builds without binaryen keep working. It passes --enable-multivalue only when a signature actually carries several results, so byte-identity is preserved for modules that never use it.

Know the shape of the cost: on the Box2D port the full pipeline is 32 ms debug, 41 ms at -O, and about 1 s at -O2 — wasm-opt dominates. And binaryen alone recovers little from naive codegen; rasc’s own inlining is the prerequisite that opens the module up.