JavaScript Runtime Internals
Event loops, runtimes, and JavaScript engine internals.
All Articles (7 articles)
-
V8 Engine Architecture: Parsing, Optimization, and JIT
Browser & Runtime Internals / JavaScript Runtime Internals 18 min readV8’s multi-tiered compilation pipeline—Ignition interpreter through TurboFan optimizer—achieves near-native JavaScript performance while maintaining language dynamism. This analysis covers the four-tier architecture (as of V8 12.x / Chrome 120+), the runtime’s hidden class and inline caching systems that enable speculative optimization, and the Orinoco garbage collector’s parallel/concurrent strategies.
-
Browser Architecture: Processes, Caching, and Extensions
Browser & Runtime Internals / JavaScript Runtime Internals 17 min readModern browsers are multi-process systems with sophisticated isolation boundaries, layered caching hierarchies, and extension architectures that modify page behavior at precise lifecycle points. This article maps Chromium’s process model (browser, renderer, GPU, network, utility processes), the threading architecture within renderers (main thread, compositor, raster workers), caching layers from DNS through HTTP disk cache, speculative loading mechanisms, and extension content script injection timing.
-
Browser Event Loop: Tasks, Microtasks, Rendering, and Idle Time
Browser & Runtime Internals / JavaScript Runtime Internals 15 min readSpec-accurate map of the WHATWG HTML Living Standard event loop in window and worker contexts, centered on task selection, microtask checkpoints, rendering opportunities, and idle scheduling. Focus is on latency and frame-budget trade-offs rather than beginner JavaScript async basics.
-
Node.js Runtime Architecture: Event Loop, Streams, and APIs
Browser & Runtime Internals / JavaScript Runtime Internals 13 min readNode.js is a host environment that pairs V8 with libuv, a C++ bindings layer, and a large set of JavaScript core modules and Application Programming Interfaces (APIs). This article focuses on the runtime boundaries that matter at scale: event loop ordering, microtasks, thread pool backpressure, buffer and stream memory, and Application Binary Interface (ABI) stable extension points. Coverage is current as of Node.js 22 LTS (libuv 1.49+, V8 12.4+).
-
libuv Internals: Event Loop and Async I/O
Browser & Runtime Internals / JavaScript Runtime Internals 36 min readExplore libuv’s event loop architecture, asynchronous I/O capabilities, thread pool management, and how it enables Node.js’s non-blocking, event-driven programming model.
-
Node.js Event Loop: Phases, Queues, and Process Exit
Browser & Runtime Internals / JavaScript Runtime Internals 10 min readAs of Node.js 22 LTS (libuv 1.48.0), this article covers how Node schedules input/output (I/O): libuv phases first, then V8 (the JavaScript engine) microtasks and process.nextTick(), and finally process exit conditions. Includes a spec-precise contrast to the Hypertext Markup Language (HTML) event loop and the ECMAScript job queue.
-
JS Event Loop: Tasks, Microtasks, and Rendering (For Browser & Node.js)
Browser & Runtime Internals / JavaScript Runtime Internals 17 min readThe event loop is not a JavaScript language feature—it is the host environment’s mechanism for orchestrating asynchronous operations around the engine’s single-threaded execution. Browsers implement the WHATWG HTML Standard processing model optimized for UI responsiveness (60 frames per second, ~16.7ms budgets). Node.js implements a phased architecture via libuv, optimized for high-throughput I/O (Input/Output). Understanding both models is essential for debugging timing issues, avoiding starvation, and choosing the right scheduling primitive.