Hot-Loop performance improvements in data/grid - #4600
Open
lbwexler wants to merge 1 commit into
Open
Conversation
* Column comparators resolve their GridSorter via new allocation-free GridModel.getSorter() instead of a lodash matcher per comparison; the default path resolves once and passes it into defaultComparator. Eliminates ~15M transient allocations on a 400k-row sort. * Column.buildFastValueGetter(): the default ag-Grid valueGetter now reads record data directly, skipping the per-call params object (built per cell render and twice per sort comparison). * Grid skips its post-transaction expand-state sync (an ag-Grid walk over all rows) for tree-grid updates that change no parentId. Grouped-by-value grids retain existing always-sync behavior. * FieldFilter =/!=/includes/excludes test with a Set-based lookup instead of a linear scan per record, capping the O(records x candidates) worst case from large header-filter value selections. =/!= use the Set only for all-primitive candidates, preserving isEqual semantics for Dates; includes/excludes were already SameValueZero, so the Set is an exact match.
lbwexler
force-pushed
the
hot-loop-perf
branch
from
August 21, 2026 01:28
a24277b to
86a67ea
Compare
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targeted allocation and complexity fixes on per-comparison, per-cell, and per-record hot paths, found in a follow-up perf audit after the v87 wave.
GridSortervia a new allocation-freeGridModel.getSorter()instead of a lodash{colId}matcher per comparison (which allocated matcher internals on every call - ~15M objects for one 400k-row sort). The default path resolves once and passes it intodefaultComparator; app comparators calling via params get the cheap lookup automatically.Column.buildFastValueGetter()- when a column uses the defaultgetValueFn, the ag-GridvalueGetterreadsrecord.datadirectly, skipping the per-call params object (paid per cell render and twice per sort comparison). CustomgetValueFns keep the fully-featured path.Gridnow skips its post-transaction expand-state sync - an ag-Grid walk over all rows plus deep-equal/freeze of the state tree - for updates that change noparentId. Adds/removes and grouped-by-value grids sync exactly as before.=/!=/includes/excludestest via a Set instead of a linear candidate scan per record, capping the O(records × candidates) worst case (e.g. header-filter value selections on high-cardinality columns).=/!=use the Set only when all candidates are primitives, preservingisEqualsemantics for Dates;includes/excludeswere already SameValueZero, so the Set is semantically exact.Validated in Toolbox: header sorts incl. abs-value cycling, tree grid reload with expansion preserved, grouped rows, and column filtering (
=and tagsincludes) all clean.Stacked follow-up with a second batch (StoreValidator, GridFindField, selection sync): #4602.