Hot-loop performance: StoreValidator, GridFindField, and selection sync - #4602
Open
lbwexler wants to merge 2 commits into
Open
Hot-loop performance: StoreValidator, GridFindField, and selection sync#4602lbwexler wants to merge 2 commits into
lbwexler wants to merge 2 commits into
Conversation
This was referenced Aug 21, 2026
* StoreValidator no longer syncs on every transaction of a clean store - uncommittedRecords returns a shared EMPTY constant when clean, preserving reference equality for its reaction; the tracked value is passed into the run, killing a duplicate O(n) scan when dirty. * GridFindField: data reaction now debounced with queryBuffer; result sorting uses decorate-sort-undecorate so values and ag-Grid nodes resolve once per record instead of per comparison, and sorter setup (incl. getAgSpec) is hoisted out of the tree recursion. No longer mutates record children arrays in place. * AgGridModel.setSelectedRowNodeIds applies the selection delta in at most two bulk setNodesSelected calls - unchanged rows are untouched, and select-all on a large grid no longer fires an event per row. * Grid selection sync tracks StoreSelectionModel.selectedIds, now computed independently of selectedRecords so identity-only observers skip that computed's structural compare over record contents. Fixed cullSelectionReaction silently mutating the observable.ref ids array in place - culls now notify observers.
lbwexler
force-pushed
the
hot-loop-perf-2
branch
from
August 21, 2026 14:44
a24277b to
e7c87a3
Compare
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.
Stacked on #4600 - second batch of hot-path fixes, split out for reviewability. Will re-target to
developautomatically when #4600 merges.uncommittedRecordsreturns a shared EMPTY constant when clean (reference equality keeps its reaction quiet), and the tracked value feeds the run directly, removing a duplicate O(n) scan when dirty.queryBuffer; result sorting decorates once per record (value + ag-Grid node) instead of resolving per comparison, with sorter setup (incl.getAgSpec()) hoisted out of the tree recursion. Also stops mutating recordchildrenarrays in place.AgGridModel.setSelectedRowNodeIds()applies the selection delta in at most two bulksetNodesSelected()calls - unchanged rows untouched, and select-all no longer fires an event per row. Grid tracksselectedIds, now computed independently ofselectedRecordsso identity-only observers skip that computed's structural compare over record contents (public observable semantics unchanged -selectedIdswas already documented identity-only). Includes a correctness fix:cullSelectionReactionwas mutating theobservable.refids array in place, so culls never notified observers - now reassigns.Validated in Toolbox: GridFindField query/cycle/reload on the tree grid, select-random + scroll-to-selection, and inline-edit validation incl. the dirty→clean transition. Zero console errors.