Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Improving performance (1000 fishies)
Started by hyperphonic Oct 14 2009 06:52 PM

- - - - -
1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

hyperphonic

[GLOBAL: userInfoPane.html]
hyperphonic
  • Enthusiast

  • 52 posts
  • Corona SDK

Per the interview at Mobile Orchard, it was intimated that you could achieve good performance due to Corona reusing the buffered OpenGL image if multiple assets onscreen were duplicates of each other.

I've bumped the Fishies sample to 1000 fish onscreen, and on a 3G, the performance is very poor. Going through the Lua code, it seems that lots of optimizations are already in place using local vars, so the bottleneck would probably be in the renderer.

Is this the best we're going to get out of the Corona renderer?

What other optimizations can we try to do in code or asset pre-production to get better performance?

Are we able to profile on the device (as Walter suggested in an earlier post) so we can see where memory and performance bottlenecks are?

Thanks,

- Ian

uid: 238 topic_id: 170 reply_id: 300170


[TOPIC: post.html]
#2

hyperphonic

[GLOBAL: userInfoPane.html]
hyperphonic
  • Enthusiast

  • 52 posts
  • Corona SDK

I also took the Animation3 sample, and tried generating 100 balls, 500 balls, and 500 pixel balls.

At 100 balls with properties like this:
{ radius=math.random(20), xdir=1, ydir=1, xspeed=math.random(5), yspeed=math.random(8), r=255, g=0, b=0 }

the animation was pretty jerky on a 3G.

At 500 balls with a fixed radius, the animation was unacceptably slow.

At 500 single pixel balls (radius=1), the animation was also unacceptably slow.

Are there performance improvements to be had, or is the overhead of Corona and Lua just too much for this much animation going on? One of my projects requires pushing around 5000 objects onscreen (mostly just a few pixels long each), but with distinct properties to each object. There are only about 6 different assets, but with different rotations and alpha for each.

Should I forget Corona for this app and just do it in ObjC and OpenGL direct?

Thanks,

- Ian
uid: 238 topic_id: 170 reply_id: 163



[topic_controls]
[/topic_controls]