paperbot · PL 论文追踪

全部论文 待读 收藏

P2 When Function Inlining Meets WebAssembly: Counterintuitive Impacts on Runtime Performance

当函数内联遇上 WebAssembly:对运行时性能的反直觉影响
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 论文研究 WebAssembly 编译器中函数内联优化的反直觉运行时性能影响,属于编译优化与运行时系统方向;它与用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析没有直接交集。虽然论文具有问题驱动和解释失效原因的特点,但主题明显偏离 PL 与 AI 交叉方向。引用 9 inbox
Alan Romano, Weihang Wang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:首次揭示函数内联优化在 WebAssembly 中反而拖慢运行时性能的现象,并定位其成因于编译器对执行环境的错误假设。

WebAssembly 是 C、C++、Rust 等语言的编译目标,其工具链(如基于 LLVM 的 Emscripten 与 Binaryen)在实现优化时往往隐含假设本地应用与 WebAssembly 应用的执行环境相同,却忽略了 WebAssembly 流水线中还存在浏览器编译器这一环节。这种错误假设会误导函数内联优化,使得应用内联后生成的 WebAssembly 模块反而运行更慢。本文首次系统研究函数内联对 WebAssembly 运行时性能的反直觉影响:作者检视了 Emscripten C/C++-到-WebAssembly 编译器中所用 LLVM 与 Binaryen 的内联优化 pass,并在来自 LLVM 测试套件的 127 个 C/C++ 样例上进行评估。结果显示有 66 个样例因函数内联而出现反直觉的性能退化,典型情况是把热函数内联进长时间运行的函数中。作者希望这些发现能推动后续工作,在修订既有优化时充分考虑 WebAssembly 执行环境的独特特性。

问题
WebAssembly 编译器基础设施隐式假定本地与 WebAssembly 执行环境一致,忽略浏览器编译器,导致函数内联优化可能反而降低 WebAssembly 模块的运行时性能。
方法
检视 Emscripten C/C++-到-WebAssembly 编译器中所使用的 LLVM 与 Binaryen 内联优化 pass,分析其假设与 WebAssembly 执行环境的错配。
评估
在来自 LLVM 测试套件的 127 个 C/C++ 样例上评估内联前后的运行时性能,发现 66 个样例出现反直觉退化,多源于将热函数内联进长时间运行的函数。
原文摘要(Abstract)

The WebAssembly standard defines a bytecode format serving as a compilation target for languages such as C, C++, and Rust. WebAssembly compilers are built on top of existing compiler infrastructures such as LLVM and newly developed compiler toolchains such as Binaryen, handling various new features of the WebAssembly language. However, we observe that both these new and existing infrastructures implicitly assume that the execution environments of native and WebAssembly applications are the same, ignoring the presence of browser compilers in the WebAssembly pipeline. This incorrect assumption often misguides function inlining optimizations, resulting in a slower WebAssembly module when function inlining is applied. This paper is the first to investigate the counterintuitive impacts of function inlining on WebAssembly runtime performance. We inspect the inlining optimization passes of the LLVM and Binaryen infrastructures used in the Emscripten C/C++-to-WebAssembly compiler. Our investigation on 127 C/C++ samples from the LLVM test suite shows that 66 samples exhibit counterintuitive behavior due to function inlining, particularly from inlining hot functions into long-running functions. We hope our findings motivate further work on revising existing optimizations with the unique characteristics of WebAssembly environments in mind.

链接与引用

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

BibTeX
@inproceedings{Romano023,
  title = {When Function Inlining Meets WebAssembly: Counterintuitive Impacts on Runtime Performance},
  author = {Alan Romano and Weihang Wang},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616311}
}