How Node.js Bootstraps Itself: 2019 Edition
summary
Explains how Node now embeds a V8 startup snapshot — a serialized context blob compiled into the binary so the engine deserializes primordials instead of re-running JS at startup — and how internal JS modules are compiled at build time, yielding about a 40–60% speedup in bootstrap. Covers concrete changes: resource constraints, isolate/context lifecycle, event loop handles, inspector watchdog threads, worker vs child-process setup, and ongoing work to snapshot runtime-independent environment pieces.
AI-written summary · about
chapters (19)
- 0:00Start
- 0:15About me
- 0:44Overview of a Node.js process
- 1:37Creating a Worker
- 1:59Creating a child process
- 2:10Overview of the bootstrap
- 3:15Setting up the V8 isolate
- 5:11Creating a vm Context
- 5:24Setting up the V8 context
- 7:27Setting up the Environment
- 8:32Environment: internal loaders
- 9:47Environment: globals
- 10:44Environment: initialize hooks
- 11:33Environment: initialize the event loop
- 12:42Environment: inspector
- 13:40Pre-execution
- 15:22Start execution: from CLI
- 15:40Start execution: Worker
- 16:15Summary
related talks
41mDissecting NodeJS - How it works under the hood
41mBoF: Getting Started with Node.js
36mGetting Started with Node.js
36mGetting Started with Node.js
17mV8 engine, JS Code Interpretation, and Execution
49mA Journey into Node.js Internals
24mYou Did What? Understanding Node.js Optimizations
29mHow NodeJS Works (V8, libuv, async, bindings)
