-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
BUG: Possible inefficient updates to Brain #8986
Copy link
Copy link
Closed
Labels
Description
One reason Brain is (probably) slower on CIs and example builds is that it does at least some unnecessary updates. For example on #8985 + #8975 if I add a mne.set_log_level('debug') in some test script, each time I tweak a clim or update a time point I get:
>>> brain.set_time_point(0)
Color mapping 'curv' with Greys colormap and range [-1, 2]
Color mapping 'data' with <class 'numpy.ndarray'> colormap and range [4.73, 14.18]
Color mapping 'curv' with Greys colormap and range [-1, 2]
Color mapping 'data' with <class 'numpy.ndarray'> colormap and range [4.73, 14.18]
So it's being mapped twice. And if I modify the _Brain code to have this:
def _update(self):
logger.debug('Update')
Just on init I see:
Update
Update
Update
Update
Update
Update
So we get 6 renderer updates. This last part might not actually matter since just having _update return immediately it's still ~4 seconds to open the window and exit.
So this is mostly an issue to remind us to track down and profile to see where time is being taken.
Reactions are currently unavailable