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): eliminate per-frame allocations of Path, Paint, and TextPainter in ErdRelationPainter #1518
In lib/features/erd/widgets/erd_relation_painter.dart (lines 36–98):
Inside ErdRelationPainter.paint(Canvas canvas, Size size), the rendering loop iterates over all diagram routes on every single animation frame of panning, zooming, or dragging:
for (final r in routes) {
if (_focused(r) != pass || r.points.length <2) continue;
final paint = material.Paint() ... // Reallocated for each route
canvas.drawPath(roundedPath(r.points), paint); // Full Path recalculated for each route// Cardinality labels '1' and '*':_label(canvas, r.relation.oneToOne ?'1':'*', ...);
}
Inside _label():
final tp = material.TextPainter(
text: material.TextSpan(text: text, style:TextStyle(...)), // 3 allocations per label
)..layout(); // Synchronous text layout pass
tp.paint(canvas, ...);
tp.dispose();
On a realistic schema with 150 tables and 300 relations:
Activity
perf(erd): relation painter reuses one Paint, the rounded paths and t…