Skip to content

perf(grid): do not full re-sort on every staged cell edit #875

Description

@ZhuchkaTriplesix

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    data-gridInteractive data grid, cell editor, filtering, groupingsfrontendTheme parser epic label: frontendperformanceTheme parser epic label: performance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions