When Function Inlining Meets WebAssembly: Counterintuitive Impacts on Runtime Performance
Alan Romano, Weihang Wang
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers5
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only FuzzingXiao Wu, Junzhou He, Liyan Huang, Cai Fu et al.WWW 2025 · 5 citations
- CLARC: C/C++ Benchmark for Robust Code SearchKaicheng Wang, Liyan Huang, Weike Fang, Weihang WangICLR 2026 · 3 citations
- Concurrency-Aware Register Stacks for Efficient GPU Function CallsNi Kang, Ahmad Alawneh, Mengchi Zhang, Timothy G. RogersMICRO 2024 · 1 citation
- 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 et al.USENIX Security 2025
Builds on9
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use CasesAaron Hilbig, Daniel Lehmann, Michael PradelWWW 2021 · 114 citations
- Swivel: Hardening WebAssembly against SpectreShravan Narayan, Craig Disselkoen, Daniel Moghimi, Sunjay Cauligi et al.USENIX Security 2021 · 74 citations
- An Empirical Study of Bugs in WebAssembly CompilersAlan Romano, Xinyue Liu, Yonghwi Kwon, Weihang WangASE 2021 · 43 citations
- Formally Verified Cryptographic Web Applications in WebAssemblyJonathan Protzenko, Benjamin Beurdouche, Denis Merigoux, Karthikeyan BhargavanS&P 2019 · 36 citations
- MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking DetectionAlan Romano, Yunhui Zheng, Weihang WangASE 2020 · 30 citations
Related papers
- Broken Promise: Differential Analysis of Functional Discrepancies Between WebAssembly and Native BinariesXiao Wu, Alan Romano, Liyan Huang, Qiwen Yan et al.WWW 2026
- Static Stack-Preserving Intra-Procedural Slicing of WebAssembly BinariesQuentin Stiévenart, David W. Binkley, Coen De RooverICSE 2022 · 18 citations
- Automated WebAssembly Function Purpose Identification With Semantics-Aware AnalysisAlan Romano, Weihang WangWWW 2023 · 14 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
- Two Mechanisations of WebAssembly 1.0Conrad Watt, Xiaojia Rao, Jean Pichon-Pharabod, Martin Bodin et al.FM 2021 · 32 citations
