When Function Inlining Meets WebAssembly: Counterintuitive Impacts on Runtime Performance
Alan Romano, Weihang Wang
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- An Empirical Study of Bugs in WebAssembly Compilers 引用了 MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection
- An Empirical Study of Bugs in WebAssembly Compilers 引用了 An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- An Empirical Study of Bugs in WebAssembly Compilers 引用了 Swivel: Hardening WebAssembly against Spectre
- Bringing Managed Language Support to WebAssembly with External Library Linking 引用了 An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- Bringing Managed Language Support to WebAssembly with External Library Linking 引用了 Swivel: Hardening WebAssembly against Spectre
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing 引用了 An Empirical Study of Bugs in WebAssembly Compilers
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing 引用了 An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases 引用了 Formally Verified Cryptographic Web Applications in WebAssembly
- Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly Containers 引用了 An Empirical Study of Bugs in WebAssembly Compilers
- Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly Containers 引用了 Swivel: Hardening WebAssembly against Spectre
- CLARC: C/C++ Benchmark for Robust Code Search 引用了 An Empirical Study of Bugs in WebAssembly Compilers
- CLARC: C/C++ Benchmark for Robust Code Search 引用了 MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection
- CLARC: C/C++ Benchmark for Robust Code Search 引用了 WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing
- CLARC: C/C++ Benchmark for Robust Code Search 引用了 An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
引用它的顶会 Paper5
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only FuzzingXiao Wu, Junzhou He, Liyan Huang, Cai Fu 等WWW 2025 · 5 次引用
- CLARC: C/C++ Benchmark for Robust Code SearchKaicheng Wang, Liyan Huang, Weike Fang, Weihang WangICLR 2026 · 3 次引用
- Concurrency-Aware Register Stacks for Efficient GPU Function CallsNi Kang, Ahmad Alawneh, Mengchi Zhang, Timothy G. RogersMICRO 2024 · 1 次引用
- Bringing Managed Language Support to WebAssembly with External Library LinkingShuyao Jiang, Ruiying Zeng, Yangfan Zhou, Michael R. LyuFSE 2026
- Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly ContainersZhaofeng Yu, Dongyang Zhan, Lin Ye, Haining Yu 等USENIX Security 2025
它引用的 Paper9
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use CasesAaron Hilbig, Daniel Lehmann, Michael PradelWWW 2021 · 114 次引用
- Swivel: Hardening WebAssembly against SpectreShravan Narayan, Craig Disselkoen, Daniel Moghimi, Sunjay Cauligi 等USENIX Security 2021 · 74 次引用
- An Empirical Study of Bugs in WebAssembly CompilersAlan Romano, Xinyue Liu, Yonghwi Kwon, Weihang WangASE 2021 · 43 次引用
- Formally Verified Cryptographic Web Applications in WebAssemblyJonathan Protzenko, Benjamin Beurdouche, Denis Merigoux, Karthikeyan BhargavanS&P 2019 · 36 次引用
- MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking DetectionAlan Romano, Yunhui Zheng, Weihang WangASE 2020 · 30 次引用
相关 Paper
- A fast in-place interpreter for WebAssemblyBen L. TitzerOOPSLA 2022 · 44 次引用
- Broken Promise: Differential Analysis of Functional Discrepancies Between WebAssembly and Native BinariesXiao Wu, Alan Romano, Liyan Huang, Qiwen Yan 等WWW 2026
- Exploring Missed Optimizations in WebAssembly OptimizersZhibo Liu, Dongwei Xiao, Zongjie Li, Shuai Wang 等ISSTA 2023 · 24 次引用
- Static Stack-Preserving Intra-Procedural Slicing of WebAssembly BinariesQuentin Stiévenart, David W. Binkley, Coen De RooverICSE 2022 · 18 次引用
- That's a Tough Call: Studying the Challenges of Call Graph Construction for WebAssemblyDaniel Lehmann, Michelle Thalakottur, Frank Tip, Michael PradelISSTA 2023 · 11 次引用
