Virtual DOM & Reconciliation vs Signals and Fine-Grained Reactivity (Reactive Graph)
VDOM diffs whole component subtrees on state changes; Signals update subscribed DOM nodes in O(1).
Structured Comparison Matrix
| Dimension | Virtual DOM & Reconciliation | Signals and Fine-Grained Reactivity (Reactive Graph) |
|---|---|---|
| Mental Model | Diffs lightweight JS element trees in O(n) using type and key heuristics, batching minimal DOM mutations into a single commit phase. | Reactive model built on a directed acyclic dependency graph (Signal, Computed, Effect) updating only subscribed DOM nodes without virtual tree diffing. |
| Maturity & Domain | Baseline · Widely · State & Architecture Chrome 1+ (JS Object Diffing) · Firefox 1+ (JS Object Diffing) · Safari 1+ (JS Object Diffing) | Experimental · State & Architecture Chrome TC39 Stage 1 (polyfill) · Firefox TC39 Stage 1 (polyfill) · Safari TC39 Stage 1 (polyfill) |
| Prerequisites | Foundational primitive | |
| When Not to Use | When not to use VDOM: For high-frequency 60 fps canvas/drag coordinates or 10,000-cell spreadsheets, bypass VDOM diffing and update CSS transforms or signals directly. | When not to use Signals: For simple forms or mostly static pages, native DOM primitives avoid unnecessary abstraction overhead; for multi-step workflows with illegal state combinations, pair or replace raw signals with Finite State Machines. |
Engine Mechanics & Trade-Offs
Computes a minimal DOM mutation batch by diffing lightweight JS element trees in O(n) heuristics before committing writes to the live DOM.
Key Pitfalls: key={index} on dynamic lists: Reordering, filtering, or prepending items shifts array indices, causing the reconciler to attach row A's <input> DOM state to row B's data. Defining components inside components: Writing function Inner() {} inside Parent creates a new function reference every render, forcing a full unmoun
Glitch-free push-pull propagation over an acyclic observer graph.
Key Pitfalls: Effects writing to tracked signals (infinite loop): An effect mutating a signal it reads re-triggers the graph indefinitely until stack overflow. Losing reactivity via destructuring: Extracting const v = signal.get() outside the tracked execution scope breaks dynamic subscription.
Seen in Architecture Autopsies
A single filter click freezes the UI for 180 ms INP and triggers a visible 0.14 CLS jump in the data grid.
Changing a single URL filter triggers an infinite render loop, Maximum update depth exceeded, and a burst of 429 Too Many Requests responses.