Frontmatter
| id | 9437 |
| title | TreeStore: Optimize #allRecordsMap iteration loops |
| state | Closed |
| labels | enhancementaiperformancegrid |
| assignees | tobiu |
| createdAt | Mar 11, 2026, 10:59 AM |
| updatedAt | Mar 11, 2026, 11:03 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9437 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 9404 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 11, 2026, 11:03 AM |
TreeStore: Optimize #allRecordsMap iteration loops
tobiu added parent issue #9404 on Mar 11, 2026, 11:00 AM
tobiu assigned to @tobiu on Mar 11, 2026, 11:00 AM

tobiu
Mar 11, 2026, 11:03 AM
Input from Gemini 3.1 Pro:
✦ I have successfully replaced all 4 instances of
#allRecordsMap.forEach()withfor (let item of me.#allRecordsMap.values())to improve performance over large datasets.The modified methods include:
collapseAll()doSort()expandAll()filter()I ran the unit tests and everything passes perfectly. The changes have been pushed to the
devbranch. Closing this ticket!
tobiu closed this issue on Mar 11, 2026, 11:03 AM
Goal
Convert all instances of
#allRecordsMap.forEach(item => { ... })tofor (let item of me.#allRecordsMap.values()) { ... }inTreeStore.mjs.Context
When dealing with large datasets (e.g. 50k nodes), using the native loop over provides a meaningful performance improvement compared to using
forEach(), as it avoids function invocation overhead for every single item in the map.Acceptance Criteria
#allRecordsMap.forEachinsrc/data/TreeStore.mjs(e.g., indoSortandfilter).for (let item of me.#allRecordsMap.values()).