Speed, Speed, Speed: JavaScript vs C++ vs WebAssembly
summary
Node.js supports WebAssembly modules and native C++ addons and the benchmark compiles a C++ prime-number algorithm straight to WebAssembly and runs the same algorithm in V8. JavaScript running with V8’s baseline then Turbofan optimizing compiler is about twice as slow as native C++ on the prime-number test; with optimization disabled it balloons (examples show ~80s vs <20s). WebAssembly sits between them, very close to native with only a small call-overhead.
AI-written summary · about
chapters (9)
- 0:00Start
- 3:34WARNING!
- 7:15PROPERTY LOOKUP
- 11:11SPECULATIVE OPTIMIZATION
- 11:32Sourcecode
- 12:22OPTIMIZING COMPILER
- 16:49Baseline x86 assembly
- 21:52WEBASSEMBLY
- 24:29SPEED, SPEED, SPEED
related talks
27mSpeed, Speed, Speed: Javascript vs C++ vs WebAssembly
39mHow much performance can you get out of Javascript?
46mHow much performance can you get out of JavaScript?
35mBoost your JavaScript app
32mWebAssembly vs JavaScript: Which Is Faster?
30mNative Speed on the Web: JavaScript and asm.js
34mNode.js Can Be as Fast as C++
20mNot So Fast: Analyzing the Performance of WebAssembly vs. Native Code
