pierrejeambrun opened a new pull request, #69917: URL: https://github.com/apache/airflow/pull/69917
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 `Map` and re-rendered `Grid`, and because `useVirtualizer` (`@tanstack/react-virtual`) is on the React Compiler's hardcoded known-incompatible list, the compiler skips optimizing the whole `Grid` component. So `flatNodes` and 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. related: #69531 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.8) Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
