2013 R3 : very high CPU use at idle in Cocoa

2013 R3 : seeing high CPU use at idle in Cocoa.

Just running my app and sitting there with a couple of windows open, and one single thread running (but basically idle, in a Sleep(50) loop) I’m seeing CPU usage hovering around 81%. This is on Mac OS X 10.8.4, and shows up both in a Built app and when running from the IDE.

Exact Same app, running in 2013 R2 : cpu hovers around 2%.

Anyone else seeing this?

Easy to reproduce:

<https://xojo.com/issue/29633>

  • new desktop project
  • add a thread to window1
Window.Open
  Thread1.Run


Thread1.Run
  while true
    me.sleep(50)
  wend

In 2013 R2, this uses about 2% CPU. In 2013 R3 this uses 80% or more.

This test app also shows CPU usage problems when tested in Win32 builds as well.

[quote=34453:@Michael Diehr]Easy to reproduce:

<https://xojo.com/issue/29633>

…[/quote]
I can confirm this: It shows %CPU at 81 on my rMBP (OSX 10.8.5, test.app built with 2013r3)

105% here :frowning:

Well, the thread sleeps 99% of the time. But the main thread is the problem.
In 2013r2 it sleeps also 98% of the time.
But in 2013r3 the traces show that some heavy work is done with a timer and a lot of CF objects. Maybe Xojo engineers added a timer there to do some background work?

I was reporting this same problem on Windows during beta cycle (Beta 5, the first beta I was checking).
So I’m not alone: MAC too has this fault and maybe it is not related to single/multicore cpu.

Has anyone found a workaround/solution to this? There was a bug in R1 thread.suspend that I worked around by using thread.sleep. But now in R3 that’s using 100% CPU, too (as noted above). The only “solution” I’ve found is to go back to Xojo R1 (R2 isn’t usable for me for other reasons).

Hi Jonathan,

we are all waiting for the fix (the fault seems already been fixed) to be released.

Thanks, although from a post by Joe on this thread it seems that the Cocoa and the Windows thread CPU-use bugs may not be related. I hope the fix applies to both, of course.

Both issues have been marked as Fixed already, which means we are now waiting for Verification and then eventual alpha / beta Releases.

I’m not in the alpha program so don’t know whether that’s already happened or not. I’m eager to help test as soon as it’s available in beta.