The Life of a JavaScript Feature in V8 ft. TypedArrays
summary
Implements a new typed array prototype.clear and compares four implementations: self‑hosted JavaScript, C++, Torque, and code‑stub‑assembler (CSA). Benchmarks show JS is slow, C++ is surprisingly slower than Torque/CSA, and memset optimization (direct backing‑store zeroing) wins on hot loops. Explains the cross‑world call overhead that hurts C++, demonstrates a byteLength getter exploit that motivated safer paths, and argues for using v8 torque as a safer, fast DSL for built‑ins.
AI-written summary · about
chapters (12)
- 0:00Start
- 1:29Overview
- 2:15V8 High Level
- 5:00JS Features - Syntax
- 14:00Torque Code Example
- 15:47Torque Compilation Process
- 18:00C++ Implementation
- 18:59Torque Implementation
- 19:36CSA Implementation
- 20:00Benchmark Time
- 22:41Raw Memory View
- 23:06The classic typed array exploit
related talks
24mDemystifying V8 and JavaScript Performance
28mV8 internals for JavaScript developers
29mJavaScript in JavaScript: Inception
52mJavaScript at the Speed of Light
23mV8 Internals for JS Developers
30mV8 internals for JS developers
33mJavaScript: The V8 Engine optimization tips (...)
31mJavaScript Compilation Techniques or "Wasn't JavaScript supposed to be slow?"
