Summary
VirtualResultGrid._onStagingBufferChanged calls _updateSortedRows() whenever a sort column is active. Each cell edit therefore re-sorts the full result (O(N log N), isolate copy at N≥3000) and rebuilds a new row list. Dirty effectiveRows is also O(R) per notification.
Editing a sorted 5k-row grid on 120 Hz is a layout/CPU hitch per keystroke, not per sort click.
Scope
- Keep display rows stable while editing; apply staged values via
getCellValue / overlay instead of re-sorting the whole cap.
- Re-sort on sort-column change, row insert/delete, or explicit user action — not on every
notifyListeners.
- Avoid a second
setState in _commitEdit if the staging listener already rebuilt.
Out of scope
- Staging buffer deep-copy of original rows (separate memory tradeoff).
Summary
VirtualResultGrid._onStagingBufferChangedcalls_updateSortedRows()whenever a sort column is active. Each cell edit therefore re-sorts the full result (O(N log N), isolate copy at N≥3000) and rebuilds a new row list. DirtyeffectiveRowsis also O(R) per notification.Editing a sorted 5k-row grid on 120 Hz is a layout/CPU hitch per keystroke, not per sort click.
Scope
getCellValue/ overlay instead of re-sorting the whole cap.notifyListeners.setStatein_commitEditif the staging listener already rebuilt.Out of scope