~/talk

ES6 Collections in V8: There's Neon Inside

TalkinRussianat Я ❤ Фронтенд 2021 · on Saturday, 2021-02-27· [javascript]
slides:none on file

V8 implements ES6 Map and Set as a custom deterministic hash table: C++ arrays of buckets with packed entry triples, capacity always a power of two, load factor 0.5, and resizing that doubles or halves capacity (initial 4, max ~17M on 64-bit). Typical operations are average O(1) (worst-case O(n)); memory cost is roughly 29 MB per million Map entries (≈20 MB for Set). Weak collections are handled ephemeron-style integrated with the tricolor garbage collector, which can make cleanup much more expensive when reference cycles exist.

AI-written summary · about

  1. 0:00Introduction
  2. 3:41ES6 collections overview in V8
  3. 8:07Deterministic hash table algorithm
  4. 15:17Map and Set implementation in V8
  5. 21:25Time and space complexity
  6. 21:48WeakMap and WeakSet in V8
  7. 25:41Garbage collection for WeakRef
  8. 31:15WeakMap versus WeakRef
  9. 31:35Conclusion and resources
~/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.