paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Exploring Missed Optimizations in WebAssembly Optimizers

探索 WebAssembly 优化器中错失的优化
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 2/10 · 该论文关注 WebAssembly 优化器的错失优化与差分测试,属于编译器优化和测试领域;但用户核心画像集中在 PL 与 AI/LLM/Agent 的交叉、浮点程序分析和贝叶斯程序分析,本文既不涉及 LLM/Agent,也不直接对应静态分析在这些方向中的应用。引用 31 inbox
Zhibo Liu, Dongwei Xiao, Zongjie Li, Shuai Wang, Wei Meng
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出差分测试框架 DITWO,通过对比原生 x86 与 wasm 可执行文件的优化指示轨迹,系统揭示 wasm-opt 错失的优化及其根因。

将复杂应用部署到浏览器推动了 WebAssembly(wasm)编译工具链的发展,但已有研究显示真实 wasm 应用的性能低于预期,说明优化存在缺陷。本文首次对 wasm 优化现状进行系统深入的理解,提出差分测试框架 DITWO,用以发现 wasm 优化器错失的优化(missed optimization, MO)。DITWO 将同一个 C 程序分别编译为原生 x86 可执行文件和 wasm 可执行文件,记录两者运行时的优化指示轨迹(OITrace),每条轨迹由全局变量写入与函数调用组成——这两个性能指标能够实际且系统地反映 wasm 与原生可执行文件的优化程度差异,通过比对轨迹即可定位 MO。作者对官方优化器 wasm-opt 进行分析,成功找到 1,293 个触发 MO 的输入,经大量人工分析归纳出九类根本原因,并估计修复这些 MO 至少可带来 17.15% 的性能提升;最后总结了四条经验教训以指导更好的 wasm 优化。

问题
真实 WebAssembly 应用的性能低于预期,但其优化器在何处、因何错失优化缺乏系统性的理解与检测手段。
方法
DITWO 将同一 C 程序编译为原生 x86 与 wasm 两个版本,记录由全局变量写入和函数调用构成的优化指示轨迹(OITrace),通过差分比对两条轨迹来发现 wasm-opt 错失的优化,并人工归纳根因。
评估
在官方优化器 wasm-opt 上发现 1,293 个触发错失优化的输入,人工分析总结出九类根本原因,并估计修复后性能至少提升 17.15%。
原文摘要(Abstract)

The prosperous trend of deploying complex applications to web browsers has boosted the development of WebAssembly (wasm) compilation toolchains. Software written in different high-level programming languages are compiled into wasm executables, which can be executed fast and safely in a virtual machine. The performance of wasm executables depends highly on compiler optimizations. Despite the prosperous use of wasm executables, recent research has indicated that real-world wasm applications are slower than anticipated, suggesting deficiencies in wasm optimizations. This paper aims to present the first systematic and in-depth understanding of the status quo of wasm optimizations. To do so, we present DITWO, a differential testing framework to uncover missed optimizations (MO) of wasm optimizers. DITWO compiles a C program into both native x86 executable and wasm executable, and differentiates optimization indication traces (OITraces) logged by running each executable to uncover MO. Each OITrace is composed with global variable writes and function calls, two performance indicators that practically and systematically reflect the optimization degree across wasm and native executables. Our analysis of the official wasm optimizer, wasm-opt, successfully identifies 1,293 inputs triggering MO of wasm-opt. With extensive manual effort, we identify nine root causes for all MO, and we estimate that fixing discovered MO can result in a performance improvement of at least 17.15%. We also summarize four lessons from our findings to deliver better wasm optimizations.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{LiuXLWM23,
  title = {Exploring Missed Optimizations in WebAssembly Optimizers},
  author = {Zhibo Liu and Dongwei Xiao and Zongjie Li and Shuai Wang and Wei Meng},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598068}
}