Terrible Performance on Samsung Galaxy S, crashes on Tegra Devices

I tested my breakout game with 10 physics balls which is plenty for what I’m doing and things still run good on my phone. If I run 20+ balls I start having frame rate problems with skipping.

Good news for me but more complicated projects that use more dynamic physics objects will run into problems. [import]uid: 38820 topic_id: 9133 reply_id: 34317[/import]

just to let you know am getting all forum entries - so am monitoring this closely

and am in/out of the office the rest of the week

thanks for the great feedback

c [import]uid: 24 topic_id: 9133 reply_id: 34318[/import]

The evidence so far from all the example apps and code that chokes on the Samsung devices appears to be pointing to the physics system. Would anyone else agree with me on that? Maybe there is some internal chokepoint with he physics engine in certain conditions. [import]uid: 9428 topic_id: 9133 reply_id: 34340[/import]

Later on tonight I will make a build of the game that was giving me problems without the physics piece (as best as I can) and see how the animations and addition of images runs then on my samsung phone.

Until I do that, I am unsure if its physics related or image creation/load related (or both). I do know that another little test I did yesterday with only a scrolling background and a single sprite using physics performed wonderfully - but considering all the replies stating that a low number of images/physics objects seems to be working just fine, I am not surprised. It does give me hope though!

Really hope that this gets sorted out as Corona makes development so much easier. [import]uid: 47373 topic_id: 9133 reply_id: 34374[/import]

Hi all,

I just wanted to chime in that I, too, am having significant performance loss while working on Android devices (tested Xoom, Galaxy Tab, Droid 1, Nexus One) compared to my iPhone 3GS and iPad 1. The Xoom and Galaxy Tab versions are borderline acceptable while the Droid and Nexus One performance is unacceptable.

My game features touch events and physics bodies. I don’t mind slower animation/framerate, but the lack of responsiveness to touch events (seems to be a quarter second delay in recognizing the tap) is what’s really killing me.

I’ve stripped out all transition effects (used primarily for on-screen effects and title graphics), but the game is still slow. Judging by the responses here I’m assuming that the problem is half my at times inefficient code and half Corona android performance in general. Does anyone know if there are other likely culprits in my code (besides transitions) that I could target for optimization?

Also, could someone point me to documentation where I can find instructions on changing the device’s settings from 60fps to 30fps and vice versa? I couldn’t seem to find it.

Thanks!

Nick [import]uid: 7472 topic_id: 9133 reply_id: 35548[/import]

Yes I must agree with these performance issues. I’m running an SGS with a custom 2.2.1 firmware and lots of speed hacks. I’ve tried the pool example and it runs slick and smooth. I agree that the problem seems to stem from the physics. When running the director example created with LevelHelper, levelhelper.wordpress.com/, the cart scene seems to run fine, this has many sprites, yet still runs fast, probably eliminating the drawing theory. The scene with what must be around 60 basket balls all bouncing around, some on a bridge with joints runs painfully slow. There is also a menu scene with just one ball bouncing, this runs fast. On the physics joints example by Ansca the longer it runs, the more stone balls are added onto the bridge, seemingly the slower it gets. There does seem to be direct corellation between the number of physics bodies the engine has to track and the performance.

I will test some of the above code when I get on a computer tomorrow.

Note all of the examples ran fine on the simulator. [import]uid: 57251 topic_id: 9133 reply_id: 35554[/import]

Use need to use a config.lua file the following link will provide you with all the info and about how to set 30 or 60 fps.

http://developer.anscamobile.com/content/configuring-projects
Glenn [import]uid: 38820 topic_id: 9133 reply_id: 35555[/import]

Hi all,

I’m also getting some performance issues on a Galaxy S, even on the simplest code (below). I’ve tested this on a Nexus S as well, so it could be a Samsung thing… The simulator runs super fast.

I’ve made a simplified version of my code that just makes a circle move up and down when the screen is tapped:

local obj = display.newCircle(display.contentWidth/2, 10, 40)  
  
local function move(event)  
 if obj.y == 10 then  
 obj.y = 300  
 else  
 obj.y = 10  
 end  
end  
  
Runtime:addEventListener("tap", move)  

On the simulator, the object changes location super fast, but on my Galaxy S, it takes nearly a second to move. I am new to Corona so maybe I’ve made a huge newbie mistake, but I can’t see a bottleneck in such a simple program. I’m trying to find a friend with a non-Samsung Android phone and try it out on theirs. The idea for my app relies heavily on users quickly tapping to move an object, so a one second response time is way too much.

Having said all that, I’ve been incredibly impressed by Corona and hope to continue using it.

Cheers,
James [import]uid: 57198 topic_id: 9133 reply_id: 36089[/import]

Using newCircle drastically slows down performance on my device (samsung galaxy s, 2.3) Using build 484

local bullet = display.newCircle(0, 0, \_W\*0.06);  
bullet.x = \_W\*0.5  
bullet.y = \_H\*0.82  

Whereas using a png instead of newCircle allows for excellent performance

local bullet = display.newImage("RedBall.png"); bullet.x = \_W\*0.5 bullet.y = \_H\*0.82 [import]uid: 24981 topic_id: 9133 reply_id: 37441[/import]

Thanks for your response projectcolour. I tried replacing the top line with the line below (i.e. replacing newCircle with newImage, and there’s still a near-second lag between tapping the screen and the image moving.

local obj = display.newImage("ball.png", display.contentWidth/2, 10)

I’m going to hunt down someone with a non-Samsung android phone and see how it works on theirs. My galaxy doesn’t have problems with response time on other apps, so this is very strange.

Cheers,
James [import]uid: 57198 topic_id: 9133 reply_id: 37461[/import]

Was this ever resolved? I am also experiencing very horrible performance in my own app on Galaxy S, and bad performance even with the simple code posted by jamesrobertwilliams and projectcolour. [import]uid: 69698 topic_id: 9133 reply_id: 44336[/import]

There was no official resolution.
I’ve started work on my next game and so far am not using any physics at all and my Samsung S screams along at full 60 fps. Seems to me there is some link to the physics system and the Samsung… so at the moment, the resolution for me is to use the physics system very carefully.

I have tried some simple physics examples on the Samsung and they worked fine, but as soon as you start destroying and creating physics objects at runtime it seems to take a big dive in performance… [import]uid: 9428 topic_id: 9133 reply_id: 44604[/import]

I am also a newbie so take my advice with a grain of salt. Try this instead:

local obj = display.newCircle(display.contentWidth/2, 10, 40)  
   
local function move(event)  
  
local phase = event.phase  
  
 if phase == "moved" then  
 if obj.y == 10 then  
 obj.y = 300  
 else  
 obj.y = 10  
 end  
 end  
  
end  
   
Runtime:addEventListener("tap", move)  

I think the way you did it make the system react to all events (begin, end and move) which I am sure you did not want (you want to react only to move event) MAYBE Corona is confused because of that.

Again only my two cents…

Good luck.

Mo [import]uid: 49236 topic_id: 9133 reply_id: 44609[/import]

I am also reporting terrible performance on Android, only this time it’s on HTC EVO 4G, I have achieved really smooth 60fps performance on all iOS from 3gs all the way to ipad2, has this issue been resolved? I would really love to hear the solution. [import]uid: 11334 topic_id: 9133 reply_id: 44610[/import]

Hi everyone,

Same problem here on the Nexus S (which is almost the same as the Galaxy S). My realy simple application runs like in slow-motion while it runs perfectly on my LG Optimus 2x.
This realy is an issue for me and apperantly also to many other people in this community.
Are the any fixes for this issue in the last recent builds? As I am still a freeuser to test the whole SDK I cant check this and at the moment I am not that much convinced to buy a licence.
By the way the Galaxy S alone has over 10 Million sold Phones(Not mentioning the Nexus S, Google’s most supported Phone at the moment), so I really do hope that you will look into this. (The Phone itself has quite good hardware specs)

Kind regards
Selim [import]uid: 74763 topic_id: 9133 reply_id: 47317[/import]

I’m a subscriber the game I’m working on uses the physics engine and it appears to have gotten a little faster with each release. My game destroys and spawns new objects without slowing down. But still you cannot go crazy with too many physics objects or yes it will slow down. So you still need to take care on how you design and write your games. Next big stable Corona release is beginning of next month. Hopefully with features and performance most of us are looking for ;o) [import]uid: 38820 topic_id: 9133 reply_id: 47385[/import]

Well I’m glad to here I’m using the worst Android device (performance wise)

If it works on the galaxy S fine can I assume it will work better on all the rest?

I’m not currently having any performance issues, as long as I can get it to run at all!

Has anyone put together a table of guide lines for how many objects you can create during one run through your code?

I’m having problems blowing up the JNI by too much set up code run all at once.

In this case my performance is 0 FPS!

And yes, app works great, no issues on IOS.
I’m currently loosing confidence in the Corona-Android connection.
[import]uid: 26049 topic_id: 9133 reply_id: 54289[/import]

Firstly, as a test case remove all touch listeners and just hard code some transitions.

Secondly drop frame rate to 30fps

thirdly insert this into your enter frame:
local function enterFrame(event)
collectgarbage(“step”, 0.7);
collectgarbage(“stop”);
end

Lastly, try using 319 and building for 2.0.1

[import]uid: 8872 topic_id: 9133 reply_id: 54481[/import]

the fps on galaxy s is very low, any fix ?? [import]uid: 79884 topic_id: 9133 reply_id: 62988[/import]

the fps on galaxy s is very low, any fix ?? [import]uid: 79884 topic_id: 9133 reply_id: 62990[/import]