The Single-Thread Bottleneck and Five Failure Scenarios
Put layout, paint, input dispatch, state updates, local-first sync, client-side search, and data crunching onto one browser main thread and you build a single-queue bottleneck with a shared V8 heap. In a standard browser rendering turn, the event loop drains macrotasks, flushes microtask queues, runs style and layout recalculations, paints layers, and composites frames within a tight frame budget—roughly 16.6 milliseconds at 60 Hz. When every subsystem shares that single turn and that single heap, there is no bulkhead between a runaway loop, a multi-megabyte allocation spike, or an uncaught exception.
The physical execution chain is straightforward. Heavy work or a synchronous stall blocks the event loop thread from returning control to the compositor and input handler. Input events pile up in the task queue while pending microtasks and garbage collection pauses compete for CPU cycles on the same execution context.…