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
perf(erd): hover rebuilds and repaints the whole canvas; no viewport culling; first layout on the UI thread #1169
Hover rebuilds the whole canvas.onHover calls setState on ErdView: every _TableCard (≈ 3 000 text rows for 200 tables × 15 columns) is rebuilt and every edge repainted; roundedPath is rebuilt for each route on every paint.
_isFocused scans all relations for each card: O(tables × relations) per build.
One RepaintBoundary around the whole canvas: any change repaints all cards and edges.
No viewport culling:InteractiveViewer(constrained: false) builds and lays out every card, also the ones off screen.
First layout and routing run on the UI thread inside _load (ErdLayout.compute + ErdRouter.route), a hitch when the Diagram tab opens on a large schema.
Scope
Hover / drag / selection state in ValueNotifiers; cards listen only to whether they are highlighted.
RepaintBoundary per card; edges in two painters (base layer, highlighted layer); Paths cached when routes change.
Adjacency map computed once per schema.
Build only cards intersecting the viewport (+ margin) via InteractiveViewer.builder.
ErdLayout.compute + first route() in Isolate.run (schema and offsets are plain data), spinner until done.
ERD scenario in benchmark/app_perf_bench.dart: open / hover / drag on a generated 200-table schema.
Acceptance
Hover over a card rebuilds only the affected cards (widget test counting builds).
Benchmark: hover and drag frames within the 120 Hz budget on 200 tables; opening the diagram has no frame over 16 ms on the UI thread.
Problem
onHovercallssetStateonErdView: every_TableCard(≈ 3 000 text rows for 200 tables × 15 columns) is rebuilt and every edge repainted;roundedPathis rebuilt for each route on every paint._isFocusedscans all relations for each card: O(tables × relations) per build.RepaintBoundaryaround the whole canvas: any change repaints all cards and edges.InteractiveViewer(constrained: false)builds and lays out every card, also the ones off screen._load(ErdLayout.compute+ErdRouter.route), a hitch when the Diagram tab opens on a large schema.Scope
ValueNotifiers; cards listen only to whether they are highlighted.RepaintBoundaryper card; edges in two painters (base layer, highlighted layer);Paths cached when routes change.InteractiveViewer.builder.ErdLayout.compute+ firstroute()inIsolate.run(schema and offsets are plain data), spinner until done.benchmark/app_perf_bench.dart: open / hover / drag on a generated 200-table schema.Acceptance