Skip to content

Improve draw performance - #781

Draft
cvanelteren wants to merge 6 commits into
mainfrom
interactive-draw-performance
Draft

Improve draw performance#781
cvanelteren wants to merge 6 commits into
mainfrom
interactive-draw-performance

Conversation

@cvanelteren

@cvanelteren cvanelteren commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

This PR introduces several improvements in drawing graphs. It achieves this by optimizing the draw request. Currently, when a draw requests comes in, the entire graph is redrawn, which can be inefficient. The new approach allows for more targeted updates, reducing unnecessary redraws and improving performance.

How it works When a draw requests comes in, we cache the layout to see if a layout needs to be adjusted (otherwise it is drawn immediately). If the layout did change, we reuse tick calculations and axes measurements, then we re-use cached layouts where possible to improve performance further.

The end results it that we can improve draw performance, especially versus tight layout in raw matplotlib.

ultraplot_vs_matplotlib_overview

EDIT: just wanted to emphasize that we are not optimizing how data is handled. So when the data increases the two performances will align. What we do here, is optimize the surrounding infrastructure to prevent unnecessary redraws when there is no change. I am trying to figure out if we can do the other stuff too but in a different PR.

@cvanelteren
cvanelteren force-pushed the interactive-draw-performance branch from c2d87d1 to 18d4e4b Compare July 29, 2026 20:54
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant