Skip to content

perf(erd): opening a 200-table diagram no longer builds every card in one frame (#1546) - #1715

Merged
ZhuchkaTriplesix merged 5 commits into
devfrom
perf/erd-open-200
Oct 18, 2026
Merged

ZhuchkaTriplesix merged 5 commits into
devfrom
perf/erd-open-200

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1546 once #1714 is merged (the bench fix is a commit of that branch, so this PR carries it too).

erd_open_200 showed build p90 105–112 ms (profile build, real hardware; 139.6 ms on the CI runner against a 50 ms limit): all 200 cards mounted in one frame, and every later rebuild of the diagram rebuilt all 200 cards again.

  • Cards are reused. _cards keeps each card with what it was built from (columns, position, width, header colour, collapsed/marked/dragging, junction, menu inputs, palette, callbacks). When none of it changed the same widget is returned and Flutter skips the subtree. A pick, a drag or a toolbar change no longer rebuilds 200 cards.
  • Big diagrams mount in chunks. Above 60 tables the first frame carries 24 cards and each following frame mounts 24 more (edges are painted at once). Small diagrams mount synchronously as before.

Measured with the bench (profile, flutter run, same machine): erd_open_200 build p90 108–112 → 34–41 ms (max 45–62), erd_hover and erd_drag unchanged (0.2 ms p90).

Tests: a 100-table diagram does not carry every card in its first frame and has all of them after more frames; picking a table rebuilds fewer than 20 of 20 cards.

@github-actions github-actions Bot added bug Something isn't working performance Theme parser epic label: performance tests Theme parser epic P3 Low priority / Polish & Enhancements labels Oct 18, 2026
@github-actions github-actions Bot added this to the 0.5.0 milestone Oct 18, 2026
…panel), picking fades the others so it cannot show that
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 7055606 into dev Oct 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working P3 Low priority / Polish & Enhancements performance Theme parser epic label: performance tests Theme parser epic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant