Reproduce “Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Abhinav Jangda, Bobby Powers, Emery Berger, Arjun Guha

Researchers at the University of Massachusetts Amherst developed infrastructure to evaluate WebAssembly's performance using large-scale, unmodified Unix applications, revealing WebAssembly ran 1.45-1.55x slower than native code on SPEC CPU benchmarks. The study identifies increased register pressure, extra branch instructions, and larger code size leading to more L1 instruction cache misses as primary performance bottlenecks.

Key insights

  • WebAssembly's performance for general-purpose applications is significantly impacted by increased register pressure due to reserved registers and less effective linear scan register allocation, leading to more memory loads and stores.
  • Mandatory runtime safety checks (e.g., stack overflow, indirect call validation) and less optimized code generation for loops introduce a substantial number of additional branch instructions.
  • The combination of increased loads/stores and extra branches results in larger code sizes, which in turn leads to a higher rate of L1 instruction cache misses, contributing to increased CPU cycles and overall slowdown.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.