Repository navigation
perf(erd): relation painter reuses its Paint, rounded paths and cardinality labels (#1518) - #1685
Merged
Merged
Conversation
…he laid-out cardinality labels (#1518)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1518.
ErdRelationPainter.paintallocated, for every route and every repaint, aPaint, a roundedPathand two laid-outTextPainters (with aTextSpanand aTextStyleeach).Paintperpaint()call; its colour and width are set once per pass (others / focused) instead of per route.ErdRoutein anExpando: a repaint that only changes the focused table or the picked relation (hover, click) keeps the same routes and no longer rebuilds 300 paths.1and*in at most three colours, so each is laid out once and shared (static cache of 16 entries, disposed and restarted when a theme change brings new colours).Not measured: pan and zoom do not repaint this painter at all (the
InteractiveViewertransforms a layer), so the gain is on focus / hover / pick repaints and table drags, where the router's A* dominates. Theerd_open_200bench scenario does not run yet (#1546), so CI cannot show a number for this. Tests pin that every state (nothing focused, focused table, picked relation, route with one point, more colours than the cache holds) still paints, andshouldRepaint.