You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1][perf] parseExplainRows is invoked 3 times per render — once in ExplainTable, once in ExplainTreeView, once for maxRows #425
ExplainPanel parses QueryResult rows into ExplainRow typed objects for rendering.
Problem
src/components/explain/ExplainPanel.tsx:155, 281, 384 — parseExplainRows(result) runs result.rows.map((row) => ...) and builds ExplainRow[] 3 times for the same result. With 100 rows this is 30k row iterations + 300 colNames.indexOf calls per render.
React DevTools Profiler shows 3x row-iteration cost per render of ExplainPanel.
Expected
With 100 EXPLAIN rows, a single render does ≤ 100 row iterations (not 300).
Proposed fix
Lift parseExplainRows(result) to ExplainPanel and pass the rows down as a prop. Or const rows = useMemo(() => parseExplainRows(result), [result]); at the top level, share with both views. Scope: S.
Acceptance
With 100 EXPLAIN rows, a single render does ≤ 100 row iterations (not 300). React DevTools Profiler confirms.
Activity
perf(explain): parse the plan once, and offer Cancel from the panel
perf(explain): parse the plan once, and offer Cancel from the panel
perf(explain): parse the plan once, and offer Cancel from the panel (#…