Speed up evoked time plotting - #14249
Open
larsoner wants to merge 2 commits into
Open
Conversation
larsoner
requested review from
agramfort,
drammock and
wmvanvliet
as code owners
August 29, 2026 15:00
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 #14242
@wmvanvliet I generalized our blit code. Looks like it's actually pretty clean, steps:
brainblit code to a more general version_BlitManagerevoked.plotandevoked.plot_topoMinor changes to evoked.plot and evoked.topo are that the time
axvlinewill stay on top now, but I think that's reasonable (and expected).(5) was a pain to discover -- turns out to be caused by the modification of the contours, which removes and re-adds the set to the axes, which invalidates the draw, causing a full redraw (with nothing left to draw, so you get a blank plot). The workaround I came up with is to add a dummy no-op
axclass pass to thecontourcall, and then pull the contours from it. I'm going to work on upstreaming a warning about this and a less-hacky way to get the contours... but it might be a bit to land etc. In the meantime I think the no-op class is workable, and has a big performance boost.(5) speeds up
report.add_evokedfrom about 8s to 5s by dropping the timepoint code from over 3s to under 1s.I used Claude Opus 5 to investigate (iterating / reviewing multiple versions).