WebAssembly Is Fast: A Real-World Benchmark of WebAssembly vs. ES6

Introduction

Other WebAssembly Benchmarks

WasmBoy Benchmarking Explained

WasmBoy Benchmarking Setup

Results

Desktop

Back To Color Results on MBP 2015
  • Wasm vs. JavaScript: Wasm is ~1.67 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~1.45 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript Closure compiled is ~1.15 times as fast.
  • Wasm vs. JavaScript: Wasm is ~11.71 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~6.00 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript Closure compiled is ~1.95 times as fast.
  • Wasm vs. JavaScript: Wasm is ~1.35 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~1.38 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript is ~1.02 times as fast.

Mobile

Back To Color Results on Moto G5 Plus and iPhone6s
  • Wasm vs. JavaScript: Wasm is ~2.59 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~2.07 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript Closure compiled is ~1.25 times as fast.
  • Wasm vs. JavaScript: Wasm is ~16.11 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~8.72 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript Closure compiled is ~1.84 times as fast.
  • Wasm vs. JavaScript: Wasm is ~1.23 times as fast.
  • Wasm vs. JavaScript Closure compiled: Wasm is ~1.15 times as fast.
  • JavaScript Closure compiled vs. JavaScript: JavaScript Closure compiled is ~1.07 times as fast.

Result Analysis

WasmBoy Benchmarking Gotchas

Conclusion

  • “Was I able to bring playable Gameboy emulation to budget mobile devices and Chromebooks using WebAssembly?”
  • “Will WebAssembly allow web developers to write almost fast as native code for web browsers, and work alongside the ES6 code that we write today?”
  • “Is Wasm is about 30% faster than asm.js / JavaScript?”

--

--

--

Skate. Music. Video Games. Code. Developer / Developer Relations at Wasmer. All opinions expressed are my own. Please excuse the spelling, I am a lazy typist.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Catbot Tutorial using Zoom Chatbot CLI

#openmic

Swift & Redux

Building time relative react component using native Intl.

Trim the Fat From Your Bundles Using Webpack Analyzer & React Lazy/Suspense

JavaScript Classes Are NOT Just “Syntactic Sugar”

JS API Poem Stream

Create and List Offline-Available Pages in PWAs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aaron Turner

Aaron Turner

Skate. Music. Video Games. Code. Developer / Developer Relations at Wasmer. All opinions expressed are my own. Please excuse the spelling, I am a lazy typist.

More from Medium

Generating Open Source License Disclaimers with Yarn

THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE…

Automating render captures with PlayCanvas

Leave tracker for a website: how to catch the moment your customer is leaving

Deno.js in production. Key takeaways.