Finding and Understanding Missed Optimizations in WebAssembly Optimizer (Experience Paper)
Ruiyang Xu, Zetao Fan, Shan Huang, Ting Su
Abstract
As WebAssembly (Wasm) expands from web applications to high-performance domains, the standard optimizer, wasm-opt, is critical but frequently suffers from missed optimizations (MOs). This paper presents an experience report on detecting MOs in wasm-opt and understanding their root cause through the lens of Wasm’s tree-structured intermediate representation (tree IR). To this end, we adapt an established marker-based technique from C compilers, overcoming the constraints of Wasm’s structured control flow via a novel structure-aware instrumentation strategy. Complementing this, we design a cross-optimization differential testing strategy leveraging the monotonicity of optimization levels as an oracle. Together, these strategies enable the systematic identification of fine-grained MOs that are overlooked by existing cross-architecture methods. Our evaluation uncovered 24 distinct MOs (20 fixed, 100% confirmation rate, 0% false positive rate), demonstrating the high actionability and effectiveness of our approach. The performance impact, especially in code size, yields an average 1.30% improvement and no regressions on the Emscripten benchmark suite, further proving their practical value. Beyond detection, our analysis distills three practical lessons for designing MO testing techniques and understanding the optimization trade-offs imposed by wasm-opt’s tree IR.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 17f6c205-e98d-4ced-b29c-036f073af628Related papers
- Exploring Missed Optimizations in WebAssembly OptimizersZhibo Liu, Dongwei Xiao, Zongjie Li, Shuai Wang et al.ISSTA 2023 · 24 citations
- WASIT: Deep and Continuous Differential Testing of WebAssembly System Interface ImplementationsYage Hu, Wen Zhang, Botang Xiao, Qingchen Kong et al.SOSP 2025
- WASMaker: Differential Testing of WebAssembly Runtimes via Semantic-Aware Binary GenerationShangtong Cao, Ningyu He, Xinyu She, Yixuan Zhang et al.ISSTA 2024 · 8 citations
- An Empirical Study of Bugs in WebAssembly CompilersAlan Romano, Xinyue Liu, Yonghwi Kwon, Weihang WangASE 2021 · 43 citations
- Revealing Performance Issues in Server-Side WebAssembly Runtimes Via Differential TestingShuyao Jiang, Ruiying Zeng, Zihao Rao, Jiazhen Gu et al.ASE 2023 · 12 citations
