LearnNewsExamplesServices
Frontmatter
id8140
titleImplement VDom.getById() and optimize component.Base#onScrollCapture()
stateClosed
labels
enhancementaiperformancecore
assigneestobiu
createdAtDec 19, 2025, 10:11 AM
updatedAtDec 19, 2025, 10:17 AM
githubUrlhttps://github.com/neomjs/neo/issues/8140
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 19, 2025, 10:17 AM

Implement VDom.getById() and optimize component.Base#onScrollCapture()

Closed v11.17.0 enhancementaiperformancecore
tobiu
tobiu commented on Dec 19, 2025, 10:11 AM

Description

To improve performance and maintain consistency with Neo.util.VNode, we need to implement a dedicated getById() method in Neo.util.VDom. The current approach of using VDom.find(vdom, id) in component.Base#onScrollCapture() is slightly more expensive for the hot-path.

Tasks

  • Implement static getById(vdom, id) in src/util/VDom.mjs.
  • Update onScrollCapture(data) in src/component/Base.mjs to use VDomUtil.getById().

Rationale

VNodeUtil.getById() is already implemented. Adding VDomUtil.getById() ensures consistency and provides a faster lookup for ID-based searches in the VDOM tree, especially useful in hot-paths like scroll capturing.

tobiu added the enhancement label on Dec 19, 2025, 10:11 AM
tobiu added the ai label on Dec 19, 2025, 10:11 AM
tobiu added the performance label on Dec 19, 2025, 10:11 AM
tobiu added the core label on Dec 19, 2025, 10:11 AM
tobiu assigned to @tobiu on Dec 19, 2025, 10:16 AM
tobiu referenced in commit 7a797ea - "Implement VDom.getById() and optimize component.Base#onScrollCapture() #8140" on Dec 19, 2025, 10:17 AM
tobiu closed this issue on Dec 19, 2025, 10:17 AM