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 Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- An Empirical Study of Bugs in WebAssembly Compilers cites MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection
- An Empirical Study of Bugs in WebAssembly Compilers cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- An Empirical Study of Bugs in WebAssembly Compilers cites Swivel: Hardening WebAssembly against Spectre
- Bringing Managed Language Support to WebAssembly with External Library Linking cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- Bringing Managed Language Support to WebAssembly with External Library Linking cites Swivel: Hardening WebAssembly against Spectre
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing cites An Empirical Study of Bugs in WebAssembly Compilers
- WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases cites Formally Verified Cryptographic Web Applications in WebAssembly
- Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly Containers cites An Empirical Study of Bugs in WebAssembly Compilers
- Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly Containers cites Swivel: Hardening WebAssembly against Spectre
- CLARC: C/C++ Benchmark for Robust Code Search cites An Empirical Study of Bugs in WebAssembly Compilers
- CLARC: C/C++ Benchmark for Robust Code Search cites MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection
- CLARC: C/C++ Benchmark for Robust Code Search cites WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing
- CLARC: C/C++ Benchmark for Robust Code Search cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
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
- A fast in-place interpreter for WebAssemblyBen L. TitzerOOPSLA 2022 · 44 citations
- Broken Promise: Differential Analysis of Functional Discrepancies Between WebAssembly and Native BinariesXiao Wu, Alan Romano, Liyan Huang, Qiwen Yan et al.WWW 2026
- Exploring Missed Optimizations in WebAssembly OptimizersZhibo Liu, Dongwei Xiao, Zongjie Li, Shuai Wang et al.ISSTA 2023 · 24 citations
- Static Stack-Preserving Intra-Procedural Slicing of WebAssembly BinariesQuentin Stiévenart, David W. Binkley, Coen De RooverICSE 2022 · 18 citations
- That's a Tough Call: Studying the Challenges of Call Graph Construction for WebAssemblyDaniel Lehmann, Michelle Thalakottur, Frank Tip, Michael PradelISSTA 2023 · 11 citations
