Frontmatter
| id | 8989 |
| title | perf: Implement atomic Grid Body updates via explicit suspension flag |
| state | Closed |
| labels | enhancementaiperformancecore |
| assignees | tobiu |
| createdAt | Feb 4, 2026, 7:46 PM |
| updatedAt | Feb 4, 2026, 8:19 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8989 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 4, 2026, 8:19 PM |
perf: Implement atomic Grid Body updates via explicit suspension flag
tobiu assigned to @tobiu on Feb 4, 2026, 7:46 PM
tobiu changed title from perf: Buffer createViewData in grid.Body to coalesce updates to perf: Implement atomic Grid Body updates via explicit suspension flag on Feb 4, 2026, 7:51 PM

tobiu
Feb 4, 2026, 8:17 PM
Input from Gemini 3 Pro:
✦ Implemented atomic Grid Body updates to optimize diagonal scrolling.
Changes:
- Refactored
ScrollManager:
- Added
syncGridBodytodelayable(throttled 16ms).- Refactored
onBodyScrollandonContainerScrollto update local state (scrollTop/scrollLeft) and triggersyncGridBodyimmediately (removed their own throttles to prevent message queue flooding/latency mismatch).- Implemented
syncGridBodyusing the suspend/resume pattern viaskipCreateViewDatato ensure atomic application of both coordinates.- Modified
GridBody:
- Added
if (me.skipCreateViewData) return;guard tocreateViewDatato support the suspension pattern.This ensures that simultaneous X and Y scroll events result in a single, synchronized VDOM update cycle.
tobiu closed this issue on Feb 4, 2026, 8:19 PM
Context
Changing multiple configs that affect the view (e.g.,
scrollLeftandscrollTopduring diagonal scrolling) triggers multiplecreateViewData->updatecalls in the same tick.Solution
syncGridBody.skipCreateViewDataflag guard increateViewData.Changes
syncGridBody(throttle: 16ms) indelayable.onBodyScrollandonContainerScrollto update local state and callme.syncGridBody().syncGridBodyto use the suspend/resume pattern:this.gridBody.skipCreateViewData = true; this.gridBody.set({scrollLeft, scrollTop}); this.gridBody.skipCreateViewData = false; this.gridBody.createViewData();if (me.skipCreateViewData) return;tocreateViewData.Expected Result
Smoother diagonal scrolling and reduced
update()cycles on the Grid Body, without the latency of buffering.