Skip to content

Speed up dipole fit rendering - #14233

Merged
larsoner merged 2 commits into
mne-tools:mainfrom
larsoner:xfit-enh
Aug 28, 2026
Merged

Speed up dipole fit rendering#14233
larsoner merged 2 commits into
mne-tools:mainfrom
larsoner:xfit-enh

Conversation

@larsoner

Copy link
Copy Markdown
Member

@wmvanvliet this about doubles FPS on my machine by (with the help of Opus 5 drafting and iteratively testing for speed comparisons):

  1. Using mpl blitting for the time plot
  2. Using nearest smoothing steps (should be fine for these brain plots)
  3. Speeding up overlay computation using contiguity
  4. Only recomputing overlay parts when needed
  5. Avoiding recomputation of the contour algorithm

Many of these will also speed up plotting in brain, which is nice!

Feel free to give it a whirl and if it works for you we should be good to go

@wmvanvliet

Copy link
Copy Markdown
Contributor

Can we have the blitting code for other matplotlib figures as well? Now that we're adding more interactivity and ui-event integrations, we have more and more "time cursors" in figures. For example, plot_evoked_topo has a time cursor that is pretty slow.

@drammock

Copy link
Copy Markdown
Member

Can we have the blitting code for other matplotlib figures as well? Now that we're adding more interactivity and ui-event integrations, we have more and more "time cursors" in figures. For example, plot_evoked_topo has a time cursor that is pretty slow.

blitting should be fine for any figure where the axes ranges don't change as a result of interaction. It won't help (much) for, e.g, the raw/epochs data browser.

@larsoner
larsoner merged commit 172d68e into mne-tools:main Aug 28, 2026
31 checks passed
@larsoner
larsoner deleted the xfit-enh branch August 28, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants