Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Speedup testing of pyvista backend #7701

Merged

Conversation

GuillaumeFavelier
Copy link
Contributor

This PR disables anti-aliasing, line smoothing, smooth shading and decreases the polygon counts of tubes during testing of the pyvista 3d backend. Hopefully this will decrease testing time especially on macOS.

@GuillaumeFavelier
Copy link
Contributor Author

GuillaumeFavelier commented Apr 30, 2020

49 min 52 sec is not much of a speedup:

image

@GuillaumeFavelier
Copy link
Contributor Author

Better to look how to speedup the slowest ones:

42.08s call     mne/inverse_sparse/tests/test_mxne_optim.py::test_iterative_reweighted_tfmxne

27.91s call     mne/viz/_brain/tests/test_brain.py::test_brain_init[pyvista]

24.00s call     mne/io/eeglab/tests/test_eeglab.py::test_io_set_raw[test_raw_h5.set]

22.48s call     mne/viz/tests/test_3d.py::test_plot_evoked_field[pyvista]

21.48s teardown mne/viz/tests/test_3d.py::test_plot_sparse_source_estimates[pyvista]

19.14s call     mne/channels/tests/test_interpolation.py::test_interpolate_meg_ctf

18.97s call     mne/viz/tests/test_ica.py::test_plot_ica_overlay

17.24s call     mne/tests/test_chpi.py::test_calculate_chpi_coil_locs_artemis

16.58s call     mne/channels/tests/test_interpolation.py::test_interpolation_eeg[0.0]

15.95s call     mne/simulation/tests/test_raw.py::test_iterable

14.83s call     mne/viz/_brain/tests/test_brain.py::test_brain_screenshot[pyvista]

14.35s call     mne/beamformer/tests/test_lcmv.py::test_make_lcmv_sphere[None-None]

14.10s call     mne/viz/_brain/tests/test_brain.py::test_brain_add_label[pyvista]

14.08s teardown mne/viz/tests/test_3d.py::test_link_brains[pyvista]

14.04s call     mne/viz/tests/test_ica.py::test_plot_ica_properties

13.26s call     mne/io/artemis123/tests/test_artemis123.py::test_data

12.61s call     mne/commands/tests/test_commands.py::test_clean_eog_ecg

12.45s call     mne/commands/tests/test_commands.py::test_setup_forward_model

12.34s call     mne/viz/tests/test_3d.py::test_renderer[mayavi]

@codecov
Copy link

codecov bot commented Apr 30, 2020

Codecov Report

Merging #7701 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #7701      +/-   ##
==========================================
- Coverage   90.24%   90.24%   -0.01%     
==========================================
  Files         455      455              
  Lines       84621    84626       +5     
  Branches    13399    13401       +2     
==========================================
+ Hits        76363    76367       +4     
  Misses       5392     5392              
- Partials     2866     2867       +1     

@GuillaumeFavelier
Copy link
Contributor Author

The last one is already a bit better with 44 min 16 sec:

image

========================== slowest 20 test durations ===========================

36.99s call     mne/inverse_sparse/tests/test_mxne_optim.py::test_iterative_reweighted_tfmxne

23.45s call     mne/io/eeglab/tests/test_eeglab.py::test_io_set_raw[test_raw_h5.set]

22.00s call     mne/viz/tests/test_3d.py::test_plot_evoked_field[pyvista]

19.57s teardown mne/viz/tests/test_3d.py::test_plot_sparse_source_estimates[pyvista]

18.00s call     mne/viz/tests/test_ica.py::test_plot_ica_overlay

16.95s call     mne/tests/test_chpi.py::test_calculate_chpi_coil_locs_artemis

15.88s call     mne/channels/tests/test_interpolation.py::test_interpolation_eeg[0.0]

15.55s call     mne/simulation/tests/test_raw.py::test_iterable

15.09s call     mne/channels/tests/test_interpolation.py::test_interpolate_meg_ctf

14.09s call     mne/viz/_brain/tests/test_brain.py::test_brain_init[pyvista]

13.58s call     mne/viz/_brain/tests/test_brain.py::test_brain_add_label[pyvista]

13.41s call     mne/viz/_brain/tests/test_brain.py::test_brain_screenshot[pyvista]

13.17s call     mne/beamformer/tests/test_lcmv.py::test_make_lcmv_sphere[None-None]

13.13s call     mne/viz/tests/test_ica.py::test_plot_ica_properties

12.71s teardown mne/viz/tests/test_3d.py::test_link_brains[pyvista]

11.75s call     mne/tests/test_epochs.py::test_reject

11.74s call     mne/io/artemis123/tests/test_artemis123.py::test_data

11.71s call     mne/commands/tests/test_commands.py::test_setup_forward_model

11.48s call     mne/viz/tests/test_epochs.py::test_plot_psd_epochs_ctf

11.21s call     mne/commands/tests/test_commands.py::test_clean_eog_ecg

@GuillaumeFavelier
Copy link
Contributor Author

The failure of Azure style is not related, I opened #7721

@GuillaumeFavelier
Copy link
Contributor Author

I did not find any other obvious ways to speed the tests further. I will look into again after #7697 but for now this is ready to be merged.

@larsoner
Copy link
Member

larsoner commented May 4, 2020

@GuillaumeFavelier it looks like a lot of the time is in test_brain. I imagine a lot of that is in the initialization of the brain object itself. Monolithic tests in general are not great, but in this case it might be worth it to make them all one test to save more time. But that can be another PR if you want

@GuillaumeFavelier GuillaumeFavelier marked this pull request as ready for review May 4, 2020 13:42
@larsoner larsoner marked this pull request as ready for review May 4, 2020 13:43
@larsoner larsoner merged commit 163ffb9 into mne-tools:master May 4, 2020
@larsoner
Copy link
Member

larsoner commented May 4, 2020

Thanks @GuillaumeFavelier !

@GuillaumeFavelier
Copy link
Contributor Author

Monolithic tests in general are not great, but in this case it might be worth it to make them all one test to save more time

This is a good idea, I'll try it out

@GuillaumeFavelier GuillaumeFavelier deleted the renderer_speedup_testing branch May 4, 2020 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants