You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=========================== slowest 20 test modules ============================
603.30s total mne/viz/tests
548.90s total mne/tests
234.70s total mne/viz/_brain/tests
173.04s total mne/preprocessing/tests
151.16s total mne/beamformer/tests
113.52s total mne/minimum_norm/tests
560.57s total mne/viz/tests
513.19s total mne/tests
210.83s total mne/viz/_brain/tests
176.37s total mne/preprocessing/tests
149.31s total mne/beamformer/tests
123.94s total mne/minimum_norm/tests
Looks like mne/viz and mne/viz/_brain are particularly painful.
At least for _Brain it would be good to figure out where the overhead comes from -- this is going to contribute at least somewhat to the mne/viz speed as well. @GuillaumeFavelier can you look into it? I know we've looked before but it's worth revisiting again probably.
For example I wonder if one little trick we could use is have a fixture that makes all objects in the scene SetVisible(False) -- if we don't actually look at the output, there's no real reason to burn software renderer cycles on it. For example we could have it in every test that uses pyvista except for one that does each type of rendering (vol, mixed, surf) so that it's still preserved one place. WDYT?
I wonder if one little trick we could use is have a fixture that makes all objects in the scene SetVisible(False) -- if we don't actually look at the output, there's no real reason to burn software renderer cycles on it.
In most of our tests, the plotters are actually closed just after rendering the scene so I'm not sure it's enough. I'll try it of course.
I was thinking about turning _add_mesh or add_actor into a no-op function.
I was thinking about turning _add_mesh or add_actor into a no-op function.
This would actually kill the testing of MNE->pyvista->VTK, so it would be better to avoid this if possible. SetVisible, on the other hand, just kills VTK->GPU (in theory at least; we trust VTK to work at this level I think)
I'd be surprised if a complex scene involving volume rendering for example doing SetVisible(False) had no impact on rendering speed. All computations involving the ray projection and stuff should be skipped completely by an efficient implementation. Maybe it's assuming too much that VTK has done these optimizations.
At the level of the GPU, even things like vertex shaders should have things in vertex and fragment shaders that just quit if they don't need to compute. At the level of the CPU, hopefully the volume rendering ray casting will only be polled by visible actors. In other words, hopefully the SetInputConnection stuff works smartly enough...
Activity
GuillaumeFavelier commentedon Sep 11, 2020
I'll take a look as soon as I can @larsoner
GuillaumeFavelier commentedon Sep 11, 2020
It's an item of #7162
GuillaumeFavelier commentedon Sep 11, 2020
In most of our tests, the plotters are actually closed just after rendering the scene so I'm not sure it's enough. I'll try it of course.
I was thinking about turning
_add_meshoradd_actorinto a no-op function.larsoner commentedon Sep 11, 2020
This would actually kill the testing of MNE->pyvista->VTK, so it would be better to avoid this if possible. SetVisible, on the other hand, just kills VTK->GPU (in theory at least; we trust VTK to work at this level I think)
GuillaumeFavelier commentedon Sep 11, 2020
But we set this actor property after everything is already mapped right? I think it's already too late for the GPU
GuillaumeFavelier commentedon Sep 11, 2020
And by "no-op" I mean returning an actor with a mapper associated to no dataset.
larsoner commentedon Sep 11, 2020
I'd be surprised if a complex scene involving volume rendering for example doing
SetVisible(False)had no impact on rendering speed. All computations involving the ray projection and stuff should be skipped completely by an efficient implementation. Maybe it's assuming too much that VTK has done these optimizations.At the level of the GPU, even things like vertex shaders should have things in vertex and fragment shaders that just quit if they don't need to compute. At the level of the CPU, hopefully the volume rendering ray casting will only be polled by visible actors. In other words, hopefully the SetInputConnection stuff works smartly enough...