Module 16 ¡ Map, Set, WeakMap, Iterators, Generators and Regular Expressions
Under the Hood: V8's Map, When a WeakMap Lets Go, Paused Generators and Regex Backtracking
ProReading
The first four lessons used these tools from the outside. This one opens them. You will see why a Map can promise both speed and order, and what "weak" really means to the garbage collector. You will see what a paused generator is in memory, and how one short regex can stop a server for minutes.
Checking what this lesson needs for youâĻ
What is inside Under the Hood: V8's Map, When a WeakMap Lets Go, Paused Generators and Regex Backtracking
- How V8 keeps a Map: a hash table that remembers order
- What a WeakMap entry needs before it is freed
- A generator object is a paused frame
- What for-of does when you stop early
- Backtracking: how the regex engine searches
- Catastrophic backtracking, counted
- Writing patterns that cannot explode