Finding and Understanding Missed Optimizations in WebAssembly Optimizer (Experience Paper)
Ruiyang Xu, Zetao Fan, Shan Huang, Ting Su
Key points
From the paper's conclusion- Together, these strategies enable the systematic identification of fine-grained MOs that are overlooked by existing cross-architecture methods.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- E2WR: An Effective and Efficient Reduction Framework for WebAssembly BinariesProceedings of the ACM on Software Engineering · 2026
- Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native AnalysesProceedings of the ACM on Programming Languages · 2026
- WASCII: Bridging WebAssembly Specifications and Implementations through LLM-Enhanced ValidationProceedings of the ACM on Software Engineering · 2026
- CLIR: Liveness-Driven and Structure-Aware Fuzzing for the Cranelift CompilerProceedings of the ACM on Software Engineering · 2026
- Obfuscation-Resilient Purpose Identification for WebAssembly FunctionsACM Transactions on Internet Technology · 2026
- WADE: An LSTM-Based Anomaly Detection Engine for WebAssembly ApplicationsarXiv · 2026