Signals and Fine-Grained Reactivity (Reactive Graph) vs Virtual DOM & Reconciliation
VDOM diffs whole component subtrees on state changes; Signals update subscribed DOM nodes in O(1).
Structured Comparison Matrix
| Dimension | Signals and Fine-Grained Reactivity (Reactive Graph) | Virtual DOM & Reconciliation |
|---|---|---|
| Mental Model | Reactive model built on a directed acyclic dependency graph (Signal, Computed, Effect) updating only subscribed DOM nodes without virtual tree diffing. | Diffs lightweight JS element trees in O(n) using type and key heuristics, batching minimal DOM mutations into a single commit phase. |
| Maturity & Domain | State & Architecture | State & Architecture |
| Prerequisites | Foundational primitive | |
| When Not to Use | 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. | 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. |
Engine Mechanics & Trade-Offs
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.
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
Seen in Architecture Autopsies
A single filter click freezes the UI for 180 ms INP and triggers a visible 24 px toolbar 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.