~/talk

Practical Optimization for V8

Talkat CascadiaJS 2014 · 2014-07-31..08-01· [javascript]
slides:none on file

Explains V8’s two-stage compilation (fast full codegen then Crankshaft optimizing) and gives concrete, measured fixes: initializing a loop counter cuts a 100M-iteration loop from ~7s to 3.6s; creating objects with a constructor is ~10x faster than adding properties afterward; closures were ~10x slower on old V8 (0.86s vs ~0.086s) but are inlined in modern V8/Node 11+. Recommends initialize variables, use constructors and set properties in them, and favor monomorphic functions to avoid deopt and slow inline caches.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 2:14Goals of optimization
  3. 5:00V8 compilation process
  4. 10:44Hidden classes in V8
  5. 15:18Allocation and reallocation costs
  6. 17:03Uninitialized variables impact
  7. 18:29Object initialization best practices
  8. 20:40Key optimization principles
  9. 21:26Function inlining in V8
  10. 24:52Understanding compiler optimizations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.