Fast paths touch only what changed
Appending or removing an item does not rebuild the surrounding list.
Appending or removing an item does not rebuild the surrounding list. The reconciler first skips equal nodes at the start and end, then works on the changed region.
| Before | After | DOM work |
|---|---|---|
a, b, c |
a, b, c |
None |
a, b, c |
a, b, c, d |
Insert d at the end |
b, c, d |
a, b, c, d |
Insert a at the start |
a, b, c |
a, c |
Remove b |
a, b, c |
b, c, a |
Move a to the end |
These operations keep the other nodes intact. Reversing a list needs more moves, but it still reuses every surviving node.