Benchmarking JavaScript
summary
Shows concrete cases where microbenchmarks mislead: a manual inlining causes a 10x slowdown, a GS/Perf string split turns out to be an empty-loop artifact, and prototype/getter benchmarks flip an 8x result because old V8 behavior is different. Uses the IRHydra inspector and d8 standalone v8 runs to read V8 IR, find optimizer passes, and demonstrate deoptimizations that produce a 3x slowdown or an 18% loss that a code-pattern workaround restores. Concludes: verify with real code and inspect IR, not headlines.
AI-written summary · about
chapters (32)
- 0:00Intro
- 0:34Complexity
- 3:58Benchmarking
- 9:09Browsers
- 11:25Compiler
- 13:14Loop invariant
- 14:53Dead code elimination
- 16:29How to write smarter benchmarks
- 17:47Loop unrolling
- 18:31Micro benchmarks vs VMs
- 18:47How benchmarks find bugs in VMs
- 20:32What happened with my patented blaze
- 20:47The Tool
- 22:29Interesting Mode
- 24:07Constant Fault
- 24:25Fix
- 25:03presumption of innocence
- 25:32jumping to conclusions
- 27:56note
- 28:26speed test
- 28:49light
- 29:04twice
- 29:21multiple optimized versions
- 29:52tags
- 32:31counter
- 32:55desert
- 33:10benchmark
- 34:11method call speed
- 34:35no function benchmark
- 36:33function call benchmark
- 39:33dont benchmark things
- 40:08back in v8
related talks
16mJavaScript & Metaperformance
38mJavaScript Performance Through a Spyglass
28mPerformance Profiling for V8
22mHigh Performance JS in V8
29mExtreme JavaScript Performance
24mDemystifying V8 and JavaScript Performance
23mJoin the super secret V8 club & become a JavaScriptbender
31mJavaScript Compilation Techniques or "Wasn't JavaScript supposed to be slow?"
