[open] OpenSesame slow in Windows
Hi,
I developed my experiment in Ubuntu and the setup was working very well. Then I tried it in Windows and it was noticeably slow. It works, but it's slow. I tried three different computers all running 64bit Windows 7. I tried both the installed and the stand-alone OpenSesame version, the behavior is exactly the same.
I made a minimal working example that showcases the problem, you can find the script here:
https://drive.google.com/file/d/0B0we-jA4ej6eUjIzYTBVNXBSYjA/view?usp=sharing
You will also need the Deja Vu Sans font. You can get it from here: http://dejavu-fonts.org/wiki/Download
Running the example shows:
- A normal text message. Clicking the left mouse button gets you to the next screen.
- A form with a lot of text. Clicking the button gets you to the next screen (you need to mark at least one checkbox).
- A form with much less text. Clicking the button gets you to the next screen (you need to mark at least one checkbox).
- A normal text message.
The forms in step 2 and 3 are generated by calling the same python function just with different arguments. If you run the experiment in Windows you will notice:
- After clicking the mouse button in screen 1, it takes a significant amount of time for screen 2 to appear (close to a second).
- In screen two, clicking on any of the check boxes makes the mouse cursor disappear and then it reappears after a significant delay (about 1 second again). It seem like clicking on a check box makes the screen redraw itself, and the amount of times this takes is very similar to the amount of time it took for screen 2 to appear in the first place. In any case, clicking several check boxes is quite slow and even a bit annoying.
- In screen three, there is still a delay when clicking check boxes, but it is much reduced compared to screen two. The only difference is that there is a lot less text.
Could it really be that having an extra two sentences of text adds so much to the rendering time? In Ubuntu everything works very quickly and I never noticed any problems. Since my experiment will measure time (relatively short intervals) a delay of 1 second is absolutely unacceptable.
Do you have any idea what's causing this? Is it a bug? Is there something I can do to improve my setup?
Thanks a lot.
Mitko
Comments
I also have noticed a significant change in performance in Windows, but not during the experiment. I notice that programming the experiment in the GUI is taking significantly longer to do than in 2.8. Are you using 2.9? All of these versions (2.9-2.9.2) seem to be slower on Windows (XP, 7 and 8.1) than the 2.8 versions. Yesterday I checked my computer's resources while OpenSesame 2.9 was open and noticed it was utilizing nearly a gig of RAM while programming. I suspect there's a memory leak somewhere in the Windows version.
Hi guys,
These are two separate issues.
@mitko First off, congrats on a pretty sophisticated experiment, with custom forms widgets and everything. As for the performance issue, this is a known problem with forms. The rendering process on the hardware accelerated back-ends is very inefficient (for this purpose), and depending on your system that can make forms unacceptably slow. You can find some tips here:
@imnotamember As it happens, 2.9.3 should improve performance of the GUI when working with large experiments. It would be very helpful if you could test the latest prerelease and let us know if this works better for you:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thanks for developing OpenSesame and making my sophisticated experiment possible
Regarding the slowness issue, I tried switching OpenGL to 'no' but that didn't seem to make any difference. When I have time, I will create a Linux virtual machine and see if the experiment runs better there. If you have any other tips for better performance, let me know.
Have in mind that the machine I'm trying this on is actually quite powerful, so it's not a hardware problem (overclocked Intel i7@4.5GHz, 16 GB ram, Nvidia 980gtx 4GB ram).
A side question: in a number of places you say that the different back-ends and settings have different time precision, but it's never fully clear to me what this precision is. Is it 1ms, 5ms, 10ms, 100ms, 1s? Could you list (or point me to a page) where I can see more precise information (it's OK to get technical here: what dictates the precision)? For my experiment I need millisecond precision. Which back-end/settings combination allow me to measure this?
Cheers,
Mitko
That's odd. And using the legacy back-end?
The main difference is whether display timestamps reflect the onset of a new refresh cycle. Even if the display is locked to the v-sync, which is usually the case, this may not be reflected in the timestamps. If not, you have an error that's on average half a frame duration, so about 8 ms on a 60 Hz monitor. You can find a lot of details here:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
WOW, that link contains a lot of information about timings. Next time I'll make sure to take a much better look at the website before asking questions Thanks a lot for that.
I can't directly use the legacy backend since it does not recognize the "DejaVu Sans" font. I had a separate post about that. The problem is that it is looking for the wrong file name.
When I have a little time I might try with another font. But I first need to find one that has a checkbox symbol
Cheers,
Mitko
Hi Sebastiaan,
I've read the timing information and found it very useful, thank you.
I also tried the legacy back end and there everything was running fast. Now that I understand the timings better I think legacy will still provide enough accuracy for my experiment. So I'd like to use that.
The only problem I have with it, is the font. If I try any of the built-in options (mono, sans, hindi ...) it works, but none of those fonts have a checkbox. If I select 'other...' and pick any font, running the experiment immediately quits and says it can't find that font. I tried Arial, Calibri, Verdana and a few others (on Windows). Any idea what I can do to make this work?
Thanks a lot for your support!
Cheers,
Mitko
Hi Mitko,
There was a bug with custom fonts in the legacy backend. (Spotted by you?) This should be fixed in the latest 2.9.3 prerelease:
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Yes I reported that bug. I'm glad to see it will be fixed in the upcoming release.
I just tried the pre-release version using the legacy engine and everything is running very smoothly with custom fonts. I will use either this or the the final 2.9.3 version if it comes out before I run my experiment.
So I consider my issue resolved. Thank you very much for your help. As always very quick and helpful responses by you and the OpenSesame team. You guys are doing a great job
Cheers,
Mitko
Hey Sebastiaan,
The pre-release is definitely more efficient with my larger experiment. Thanks for the update.
Best,
Josh