Frontmatter
| id | 9318 |
| title | Optimize VDom Helper hot paths to reduce GC pressure |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Feb 26, 2026, 11:03 PM |
| updatedAt | Feb 26, 2026, 11:06 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9318 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 26, 2026, 11:06 PM |
Optimize VDom Helper hot paths to reduce GC pressure
tobiu assigned to @tobiu on Feb 26, 2026, 11:06 PM

tobiu
Feb 26, 2026, 11:06 PM
Input from Gemini 3.1 Pro:
✦ The optimizations for the VDOM worker hot paths have been implemented and pushed to
dev.Key changes:
Helper.mjs: ReplacedObject.keys().forEachandObject.entries().forEachwithfor...inloops incompareAttributesandcreateVnodeto avoid array allocations and closure overhead.Helper.mjs: Refactored.forEachonchildNodesarrays intoforloops increateVnodeMap,findMovedNodes, andgetFragmentPhysicalCount.Helper.mjs: ChangedObject.entries().forEachtofor...ininupdateBatch.VNode.mjs: OptimizednormalizeClassNameto use plainforloops instead of.forEachand.filter(Boolean).Closing this ticket.
tobiu closed this issue on Feb 26, 2026, 11:06 PM
This ticket continues the GC pressure reduction effort, focusing on the VDOM worker's hot paths (
src/vdom/Helper.mjsandsrc/vdom/VNode.mjs).The VDom Worker can generate thousands of delta updates. Array allocations and closures inside looping constructs create significant GC pressure.
Changes:
Object.keys().forEach()andObject.entries().forEach()withfor...inloops inHelper.compareAttributesandHelper.createVnode..forEachloops on child arrays to use standardforloops inHelper.createVnodeMap,Helper.findMovedNodes, andHelper.getFragmentPhysicalCount.normalizeClassNameinVNode.mjsto avoid.filter(Boolean)and.forEachclosures.Object.entries().forEach()tofor...ininHelper.updateBatch.These optimizations will make the VDOM generation and diffing process much lighter on memory allocations.