Hot-loop performance: grid-layer micro-costs - #4606
Merged
Merged
Conversation
lbwexler
force-pushed
the
hot-loop-perf-5
branch
from
August 21, 2026 14:44
94e4b22 to
b783255
Compare
lbwexler
force-pushed
the
hot-loop-perf-5
branch
from
August 21, 2026 19:02
14e44df to
c986c54
Compare
lbwexler
force-pushed
the
hot-loop-perf-5
branch
from
August 21, 2026 19:50
c986c54 to
bbeeff5
Compare
lbwexler
force-pushed
the
hot-loop-perf-5
branch
from
August 21, 2026 19:52
bbeeff5 to
dc04dda
Compare
* GridModel.getStateForColumn uses a native find with a plain predicate - was a lodash {colId} matcher allocation per call, called per visible column per transaction via Grid.syncData.
* GridHScrollbar resolves its three ag-Grid viewport elements once on link - was one to two querySelector DOM traversals per scroll event.
* managedRenderer forwards a fixed two-arg call - was an arguments object + Function.apply per render call of every wrapped renderer, incl. per record x column during autosize sampling. Wrapped renderer types cap at two params.
Only rendered, selected, and searched records are ever asked for an agId, but every record paid for one on load. Deferring the concat to first read cuts 6.3MB of retained heap per 200k-record store (45.9 -> 39.6MB, measured with forced gc); timing gain is ~2ms per load, within harness noise. A store whose every agId gets touched (e.g. a find-field query over the full store) lands ~2MB above the eager version - the right trade for grids where a few hundred rows of many are ever rendered.
lbwexler
force-pushed
the
hot-loop-perf-5
branch
from
August 21, 2026 19:56
dc04dda to
ef80e21
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.
Fifth batch in the stack (#4600 β #4602 β #4603 β #4604 β this) - pure internal reorg, no API or behavior changes. Deliberately trimmed to three items with real multipliers (a cellClass static-array precompute and a ZoneGridRenderer cleanup were built, then rejected as cheap-regime churn - rationale in the working notes).
findwith a plain predicate - was a lodash{colId}matcher allocation per call, called per visible column per transaction viaGrid.syncData(and from autosize / h-scrollbar paths).querySelectorDOM traversals per scroll event, on the frame-critical path.argumentsobject +Function.applyper render call of every wrapped renderer, including per record Γ column during autosize sampling. Wrapped renderer types (ColumnRenderer,GroupRowRenderer) cap at two params, and the fixed signature is easier to reason about than the reflective forward.Validated in Toolbox: standard grid render/sort, column chooser hide/show round-trip, zone grid rendering. Zero console errors.
Note: the
columnStateReactionin-place-mutation bug found during this work shipped separately as #4605 againstdevelop.