Corona.243 builds and % CPU

Create a very simple app, like

local w,h=display.contentWidth,display.contentHeight  
local menuScreen=display.newGroup()  
local bg=display.newImageRect("menubg.png",w,h)  
menuScreen:insert(bg,true)  
bg.x=w/2  
bg.y=h/2  

build it using Corona.243 and a developer Code Signing Identity. Install it on the device.
Open Instruments and choose Activity Monitor
Choose as a target the app that you just created and click Record. The % CPU never falls below 37% even though there’s no activity! Sometimes it even jumps to 50%
Build the same app using the previous versions of Corona (SDK or Game Edition). Repeat the steps above. The % CPU drops to 0 right after launch, as it should…

Isn’t 37-50% CPU a very high price for a Corona.243 build?

[import]uid: 6459 topic_id: 5146 reply_id: 305146[/import]

We address this in the latest release (268). I wrote a blog entry about this which will hopefully be posted in the not to distant future.

Now your benchmarks are a little deceiving because your app is mostly doing nothing. The audio engine will necessarily show a higher percentage of CPU utilization because nothing else is doing work. (Apple’s implementation of OpenAL runs on a background thread which is always ready to render sound which presumably minimizes latency and maximizes performance.) The real trick is when your app is actually doing something, the audio engine should be a small percentage of the real work being done. This was the bug in 243 because our attempts to yield the CPU to work on other things triggered a pathological performance bug on iOS devices (Mac is unaffected) and ironically made things worse. 268 is a whole lot better. I’ve filed some performance bugs with Apple, and we continue to look at how we can improve things even more.

[import]uid: 7563 topic_id: 5146 reply_id: 19318[/import]

Just downloaded Corona SDK Build 268 an compiled a simple app for Android:

[lua]local mySquare = display.newRect(display.contentWidth / 4, display.contentHeight / 4, display.contentWidth * 0.5, display.contentWidth * 0.5)
mySquare:setFillColor(255, 255, 255)[/lua]

It just draws a white rectangle, nothing more. However the app is constantly sucking 7-13% cpu usage on my Samsung Galaxy S without doing anything at all. I observed this behaviour with build 248 and was hoping that 268 might bring improvement on this issue but it’s still the same.

I understand that Corona is a marvelous, efficient tool for building rich multiplatform mobile games and such (apps that one expects to drain the battery quickly anyway). But for a rather small app or a background service (not sure if this is possible with Corona) thats supposed to run a while, i find cpu usage unacceptable.

Did I miss something (like sprite buffering or so) or is this just the way it is?

P.S.: I’m still using the trail version of 268. [import]uid: 14013 topic_id: 5146 reply_id: 21209[/import]

We’ll take a look at this. Would you submit a bug report to
http://developer.anscamobile.com/content/bug-submission
so we don’t lose track of this?

[import]uid: 7563 topic_id: 5146 reply_id: 21354[/import]

I wish to confirm the same issue. I’m building a book, and I cannot have 7-10% CPU just idling. I also tested a simple app and found that load as a background load (I.e. Not only my app). I also am using the latest build.

I checked other eBooks, which show zero load when idling.

I am testing on the iPad. [import]uid: 37366 topic_id: 5146 reply_id: 43805[/import]