Menu bar clock causes skipped refresh cycles on iMac

Summary: Updates to the menu bar clock appear to be causing the stimulus display to skip refresh cycles. I’ve seen this only on my test iMac (21.5-inch, Late 2013), which is running OS X 10.11.6. Removing the clock from the menu bar eliminates the problem.

Details: When displaying a dynamic stimulus (e.g. a drifting grating) that runs continuously for more than a minute, MWorks reports skipped refresh cycles at regular one-minute intervals. These skips correspond exactly to updates to the menu bar clock: When the minute changes, MWorks misses display updates. Often, there’s more than one missed refresh per clock tick, and sometimes two or three frames are skipped together.

I noticed this issue with recent nightly builds. Interestingly, while I don’t see the problem when running the released MWorks 0.6 binary (which was compiled against the OS X 10.8 SDK), I do see it when I recompile the 0.6 codebase against the OS X 10.11 SDK (which is what current nightlies are built against). The only explanation for this that I can think of is that applications compiled against OS X 10.9 or later SDK’s are automatically opted in to some energy saving mechanisms. While these mechanisms should not (and do not appear to) be applied to MWServer, maybe the process that updates the clock is entering a low-power state, and waking it up somehow blocks the GPU briefly?

As noted previously, I’ve only seen the problem on one machine, and removing the clock from the menu bar completely eliminates the issue. Still, this is very weird, and I hope to eventually figure out what’s happening.

I retested on the same iMac under OS X 10.9 and 10.10, and I didn’t see the skipped refresh problem in either case. I also didn’t see it on a Mac Pro and Mac mini running OS X 10.11. I’ll have to see if the problem persists when macOS Sierra (10.12) is released.

I retested on the same iMac under macOS Sierra (10.12), and the skipped refresh issue is gone. Apparently the problem is specific to 10.11.