HackerPapers

arXiv:1901.09056cs.PL

Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

Abhinav Jangda, Bobby Powers, Emery Berger, Arjun Guha

Abstract

All major web browsers now support WebAssembly, a low-level bytecode intended to serve as a compilation target for code written in languages like C and C++. A key goal of WebAssembly is performance parity with native code; previous work reports near parity, with many applications compiled to WebAssembly running on average 10% slower than native code. However, this evaluation was limited to a suite of scientific kernels, each consisting of roughly 100 lines of code. Running more substantial applications was not possible because compiling code to WebAssembly is only part of the puzzle: standard Unix APIs are not available in the web browser environment. To address this challenge, we build Browsix-Wasm, a significant extension to Browsix that, for the first time, makes it possible to run unmodified WebAssembly-compiled Unix applications directly inside the browser. We then use Browsix-Wasm to conduct the first large-scale evaluation of the performance of WebAssembly vs. native. Across the SPEC CPU suite of benchmarks, we find a substantial performance gap: applications compiled to WebAssembly run slower by an average of 45% (Firefox) to 55% (Chrome), with peak slowdowns of 2.08x (Firefox) and 2.5x (Chrome). We identify the causes of this performance degradation, some of which are due to missing optimizations and code generation issues, while others are inherent to the WebAssembly platform.

arXiv comments
Accepted (to appear) at USENIX Annual Technical Conference 2019
Journal reference
DOI
doi:10.5555/3358807.3358817
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Dec 2020 to Nov 2025. Found in 5 HN submissions from Jan 2019 to Nov 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • (2019) https://arxiv.org/abs/1901.09056 2022, two comments https://news.ycombinator.com/item?id=33054931 2019, 172 comments https://news.ycombinator.com/item?id=19023413 Given that this paper is from so long ago, running new benchmarks on existing runtimes would be productive.…

      seg_lolView on HNParent context

    • WebAsm is not performance competitive: "We find that the mean slowdown of WebAssembly vs. native across SPEC benchmarks is 1.55× for Chrome and 1.45× for Firefox, with peak slowdowns of 2.5× in Chrome and 2.08× in Firefox." https://arxiv.org/pdf/1901.09056.pdf

      nn3View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.