-
-
Notifications
You must be signed in to change notification settings - Fork 202
Optimize Grid hot paths to reduce GC pressure #9319
Copy link
Copy link
Closed
Labels
Description
This ticket optimizes the hot paths within the buffered grid to reduce GC pressure and improve scrolling/rendering performance.
The Grid's virtual scrolling mechanism relies heavily on iterating over rows, columns, and cell components. Using .forEach() with inline arrow functions in these tight loops allocates arrays (like Object.values()) and closures repeatedly.
Changes:
src/grid/Body.mjs: Replaced.forEach()loops with highly efficientforloops, particularly in hot paths likeonStoreRecordChange,getColumnCells, and config setters that iterate overme.items.src/grid/Row.mjs: ReplacedObject.values(me.components).forEach()withfor...inloops to avoid intermediate array allocations and closures during component state updates and destruction. Refactored.forEachonoldCnto a standardforloop during cell VDOM recycling.src/grid/Container.mjs: Replaced.forEachincreateColumns,bulkUpdateRecords, andremoveSortingCsswithforloops.
These optimizations are crucial for maintaining 60fps scrolling performance, especially when rapidly recycling rows with many cell components.
Reactions are currently unavailable