-
-
Notifications
You must be signed in to change notification settings - Fork 202
perf: Increase Grid ScrollManager throttle to prevent worker message flooding #8995
Description
Context
The Neo.grid.ScrollManager currently uses a 10ms throttle for syncGridBody. This is extremely aggressive (targeting 100fps) and exceeds the standard browser frame rate of 60fps (~16ms).
Problem
In heavy components like the Grid, a 10ms update frequency floods the message queue between the App Worker, VDom Worker, and Main Thread. This causes a backlog of updates, resulting in severe input lag (1.5 - 2s) during diagonal scrolling, as the Main Thread struggles to catch up with the worker's output ("Death Spiral").
Solution
Increase the throttle timer to 48ms (approximately 20fps). This provides a safe buffer for the worker communication pipeline to clear, ensuring responsive updates without queue flooding.
Validation
User testing confirmed that 48ms eliminates the lag and makes updates feel "instant".
Proposed Change
Update src/grid/ScrollManager.mjs:
syncGridBody: {type: 'throttle', timer: 48}