I’ve noticed over the last couple of years that PsychoPy lags for long periods of time when exiting complex experiments. This seems to specifically affect experiments in which component parameters are set to update every frame (e.g., with “Each frame” code components controlling these parameters), and the time period of the lag appears to correlate with the amount of frame-by-frame updates. In these cases PsychoPy becomes non-responsive for several minutes upon exiting, then lots of information will print to the runner all at once.
Interestingly, this lag seems specific to the PsychoPy runner, and does not occur when running in an external IDE (e.g., PyCharm)
My best guess as to what’s happening is that somewhere in setting parameters “Each frame”, PsychoPy is being told to log these component updates, which is then printing all at once when the experiment ends. I can’t see where this is happening in the background, or make sense of why the PsychoPy runner struggles compared to running in PyCharm?
Based on another recent thread I have tried setting logging level to “error”, however it doesn’t seem to change the behaviour still appears to be logging “EXP” information.
I’m sure this didn’t used to happen in former versions of PsychoPy (e.g., pre-2023). It would be useful to know whether there’s something I’m missing or a potential performance fix in the future.
Attached is a sample project that makes lots of use of Each frame updates
Project 4.zip (4.2 MB)