How much performance can you get out of JavaScript?
summary
Shows concrete limits and wins: benchmarks start with Node JS at ~6s versus C++ 1.5s (~4.5×), then fixing array bugs and preallocating brings JS to ~1.3s and C++ to 0.8s, an algorithmic change (stop at sqrt) cuts runtime to ~100ms (≈50×). Explains V8 mechanics — hidden classes, inline caches, ignition and turbofan — and tooling: Node/Chrome profilers and flags. Builds a 2000×2000 cell grid that works in JS but is much faster when memory layout is C++ style or compiled via Emscripten/WebAssembly.
AI-written summary · about
chapters (12)
- 0:00Start
- 2:06A SIMPLE PROBLEM
- 4:38HOW MUCH FASTER?
- 5:12WE NEED TO BE PREPARED
- 7:59HIDDEN CLASSES
- 10:11FAST NUMBERS
- 14:36OID THE SPEED TRAP
- 22:41MORE ENGINES!
- 30:22THE OPTIMIZING COMPILER
- 33:38DEOPTIMIZATION
- 34:30KNOW YOUR TOOLS
- 35:00ARE YOU PREPARED?
related talks
39mHow much performance can you get out of Javascript?
27mSpeed, Speed, Speed: JavaScript vs C++ vs WebAssembly
34mNode.js Can Be as Fast as C++
34mUnderstanding JavaScript Performance
29mExtreme JavaScript Performance
27mSpeed, Speed, Speed: Javascript vs C++ vs WebAssembly
30mNative Speed on the Web: JavaScript and asm.js
33mJavaScript: The V8 Engine optimization tips (...)
