DuguidLab / visiomode

A rodent touchscreen-based visuomotor behaviour platform
https://www.visiomode.org
MIT License
3 stars 0 forks source link

`pynwb` import accounts for ~75% of startup time for the Pygame app #205

Closed olivierdelree closed 6 months ago

olivierdelree commented 6 months ago

Currently, importing pynwb inside of src/visiomode/webpanel/export.py accounts for around 75% of the time required for visiomode to start (4.035 seconds with versus 1.040 seconds without on my machine). Since any import of the base visiomode module leads to the pynwb import, it would be nice to delay the import until it is needed. Because it is only needed for a single function that is actually rarely called, this would end up saving time in the vast majority of use cases (especially tests).