Re-render only the changed column when Grid summaries stream in - #69917
Merged
Conversation
Member
Author
|
Merge #69912 first, only the last commit is relevant |
Member
Author
BeforeScreen.Recording.2026-07-15.at.15.12.52.movAfterScreen.Recording.2026-07-15.at.15.13.41.mov |
pierrejeambrun
marked this pull request as ready for review
July 15, 2026 13:13
pierrejeambrun
requested review from
bbovenzi,
choo121600,
guan404ming,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
July 15, 2026 13:14
The Dag Grid streams TI summaries as one NDJSON line per run and stores them in a Map; every line replaced the Map and re-rendered Grid. Because useVirtualizer (@tanstack/react-virtual) is on the React Compiler's known-incompatible list, the compiler skips optimizing all of Grid — so flatNodes and the click handlers got fresh references on every render and every column re-rendered on every line, not just the run whose summary arrived. On a ~20-run x 30-task grid that was 117 spurious column re-renders per load. Memoize the values handed down to the columns by hand — the escape hatch the compiler's own bailout message points to for incompatible-library APIs. Measured on the same grid: column re-renders per load dropped 171 -> 54 (all legitimate), grid load render work ~47% lower. Also drop a redundant immediate stream restart: an unconditional refresh tick fired the instant the interval effect mounted, aborting and reopening the just-opened mount stream (an AbortError on every grid mount with active runs). related: apache#69531
pierrejeambrun
force-pushed
the
grid-stream-cascade
branch
from
July 15, 2026 14:37
f397387 to
d10a9ee
Compare
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
pierrejeambrun
added a commit
that referenced
this pull request
Jul 16, 2026
…eam in (#69917) (#69958) The Dag Grid streams TI summaries as one NDJSON line per run and stores them in a Map; every line replaced the Map and re-rendered Grid. Because useVirtualizer (@tanstack/react-virtual) is on the React Compiler's known-incompatible list, the compiler skips optimizing all of Grid — so flatNodes and the click handlers got fresh references on every render and every column re-rendered on every line, not just the run whose summary arrived. On a ~20-run x 30-task grid that was 117 spurious column re-renders per load. Memoize the values handed down to the columns by hand — the escape hatch the compiler's own bailout message points to for incompatible-library APIs. Measured on the same grid: column re-renders per load dropped 171 -> 54 (all legitimate), grid load render work ~47% lower. Also drop a redundant immediate stream restart: an unconditional refresh tick fired the instant the interval effect mounted, aborting and reopening the just-opened mount stream (an AbortError on every grid mount with active runs). (cherry picked from commit 93d722e) related: #69531 Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
1 task
vatsrahul1001
pushed a commit
that referenced
this pull request
Aug 5, 2026
…eam in (#69917) (#69958) The Dag Grid streams TI summaries as one NDJSON line per run and stores them in a Map; every line replaced the Map and re-rendered Grid. Because useVirtualizer (@tanstack/react-virtual) is on the React Compiler's known-incompatible list, the compiler skips optimizing all of Grid — so flatNodes and the click handlers got fresh references on every render and every column re-rendered on every line, not just the run whose summary arrived. On a ~20-run x 30-task grid that was 117 spurious column re-renders per load. Memoize the values handed down to the columns by hand — the escape hatch the compiler's own bailout message points to for incompatible-library APIs. Measured on the same grid: column re-renders per load dropped 171 -> 54 (all legitimate), grid load render work ~47% lower. Also drop a redundant immediate stream restart: an unconditional refresh tick fired the instant the interval effect mounted, aborting and reopening the just-opened mount stream (an AbortError on every grid mount with active runs). (cherry picked from commit 93d722e) related: #69531 Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
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.
Second of two stacked PRs improving Dag Grid performance. Stacked on #69912 (the hover-cascade fix) — that PR's commit shows first in this diff, so the change to review here is the second commit.
The Grid streams TI summaries as one NDJSON line per run. Every line replaced the summaries
Mapand re-renderedGrid, and becauseuseVirtualizer(@tanstack/react-virtual) is on the React Compiler's hardcoded known-incompatible list, the compiler skips optimizing the wholeGridcomponent. SoflatNodesand the click handlers took fresh references on every render, and every column re-rendered on every stream line — not just the run whose summary arrived.This memoizes the values handed down to the columns by hand. That is the escape hatch the compiler's own bailout message points to for incompatible-library APIs (the compiler source string: "TanStack Virtual's
useVirtualizer()API returns functions that cannot be memoized safely"). It also drops a redundant immediate stream restart that aborted and reopened the just-opened mount stream on every grid mount with active runs.Measured on a 20-run × 30-task grid: column re-renders per load dropped 171 → 54 (all now legitimate), grid load render work ~47% lower.
closes: #69531
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines