Frontmatter
| id | 9474 |
| title | Grid: Optimize row pooling for small datasets |
| state | Closed |
| labels | enhancementaiperformancegrid |
| assignees | tobiu |
| createdAt | Mar 14, 2026, 1:07 PM |
| updatedAt | Mar 14, 2026, 1:08 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9474 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 14, 2026, 1:08 PM |
Grid: Optimize row pooling for small datasets
tobiu assigned to @tobiu on Mar 14, 2026, 1:08 PM

tobiu
Mar 14, 2026, 1:08 PM
Input from Gemini 3.1 Pro:
✦ I have successfully implemented the grid row pooling optimization:
- Added the
rowPoolSizeclass field insrc/grid/Body.mjsinstead of hijacking internal properties.- Updated
createRowPool()to compute the needed size viaMath.min(windowSize, store.count).- Replaced all deprecated
store.getCount()occurrences withstore.count.- Ensured
getRowId()relies on the dynamicrowPoolSizeforrowIndex % poolSizemodulus calculation.This effectively minimizes the initial VDOM generation for smaller grids without impacting performance on massive ones.
tobiu closed this issue on Mar 14, 2026, 1:08 PM
tobiu cross-referenced by #9475 on Mar 14, 2026, 1:34 PM
The Grid's
Bodycomponent previously calculated its row pool size strictly based on the visible viewport height plus thebufferRowRange(availableRows + 2 * bufferRowRange).For small datasets (e.g., 9 records) displayed in a large viewport (e.g., capable of fitting 30+ rows), this caused the grid to unnecessarily instantiate and manage a large number of empty
Neo.grid.Rowcomponents that would never receive data.This optimization clamps the maximum pool size to the total number of records in the store (
store.count), significantly reducing the initial VDOM generation and memory footprint for small grids while maintaining O(1) recycling performance for large datasets.Changes:
rowPoolSizeclass field insrc/grid/Body.mjs.Math.min(windowSize, store.count).getRowId) to respect the dynamic pool size.store.getCount()calls tostore.countwithinBody.mjs.