Frontmatter
| id | 8832 |
| title | Enhancement: Implement Sparse Tree Generation for VDOM Updates |
| state | Closed |
| labels | enhancementaiperformancecore |
| assignees | tobiu |
| createdAt | Jan 20, 2026, 7:18 PM |
| updatedAt | Jan 20, 2026, 7:27 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8832 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 20, 2026, 7:27 PM |
Enhancement: Implement Sparse Tree Generation for VDOM Updates
tobiu assigned to @tobiu on Jan 20, 2026, 7:18 PM

tobiu
Jan 20, 2026, 7:27 PM
Input from Gemini 3 Pro:
✦ I have implemented Sparse Tree Generation.
Changes:
VDomUpdate.mjs: ModifiedgetMergedChildIdsto calculate and include "Bridge Paths". It now returns a Set containing not just the merged children, but all intermediate ancestors required to reach them.TreeBuilder.mjs: Enhanced expansion logic. If amergedChildIdsAllowList is present, it now prunes (sends as placeholder) any branch that is not in the list, even ifupdateDepthwould otherwise allow expansion.SparseUpdates.spec.mjs: Added a new unit test proving that clean siblings are pruned (sent as placeholders with notag) during a merged update cycle.Result: Verified that
updateDepth: 2(or greater) no longer causes "wasteful expansion" of clean subtrees. The VDOM worker receives a truly sparse tree containing only the necessary updates and the bridges to reach them. All existing VDOM tests pass.
tobiu closed this issue on Jan 20, 2026, 7:27 PM
tobiu cross-referenced by #8833 on Jan 20, 2026, 7:35 PM
Current VDOM update logic using
updateDepthcan lead to inefficient "wasteful expansion" of clean subtrees. When a parent updates withupdateDepth: 2(or greater), all children at that depth are expanded, even if they have no changes.This ticket aims to implement "Sparse Tree Generation" in
Neo.util.vdom.TreeBuilder.Goals:
updateDepthallows for deeper traversal.Tasks:
VDomUpdate.mjsto track "Bridge Paths" (ancestors that must be expanded to reach a merged child).TreeBuilder.mjsto use this bridge logic for conditional expansion.