Performance Issues, iPhone 4 vs. iPad?

A few days ago my Lime project started suffering from something odd - a huge framerate hit that only happens on device (iPhone4/3GS) and not on simulator (Air) or iPad1/3. Even worse, you only notice it if you drag your finger while moving.

After tearing apart my code for a few days and removing absolutely everything in the way, I was left with:

a. A simple enterFrame Runtime event that looks at touch position to determine where the player moves at every tile intersection. Every other frame is spent moving 4px using translate. (ie: 4px, 4px, 4px, 4px, decide, 4px, etc…)

b. A 64x64 map. Corona Profiler shows map:update() to be a tremendous performance hog so I turned that off with virtually no impact on the existing problems. There is only one tile layer, 6 tiles, and no animation.

So left with nothing else, I went down 3 routes:

  1. Made a version of the app with a .newRect() instead of lime.
  2. A 32x32 version, still using 48x48px tiles
  3. A 128x128 version, still using 48x48px tiles

Results?

  1. 60fps, no drops on any platform
  2. Smooth enough, can’t tell if it’s dropping. No platform issues
  3. On 4/3GS it’s unplayably slow, the player moves in seconds, not milliseconds. On iPad 3 if you touch and don’t move your finger after that it stumbles along. If you start finger sweeping performance drops under 1fps.

Not really sure what to do from here except ask if anyone is getting similar performance… [import]uid: 41884 topic_id: 29119 reply_id: 329119[/import]

Still working on this.

Interestingly with build 840 (border setting is only introduced in 846) performance is just overall bad. My 64x64 tilemap is < 15fps. But install build 846 and it’s 60fps unless you move your finger.

Next up:

  1. Try build 865
    2.Try building my own temp tile engine to see if this is a Lime issue or a Corona issue. [import]uid: 41884 topic_id: 29119 reply_id: 117169[/import]

Build 865 is DOA on OSX (so many acronyms…)
863 exhibits the same problems when you move your finger.

My original assumption was either: user error or Lime problems. But now I’m not so sure. With or without map:update, if I:

a. touch and hold in a direction, it’s 60fps smooth sailing
b. touch and hold, but drag: < 15fps at best.

There is no event.phase == “moved” code in the project, and move calculation only occurs every 12th frame. (Plus according to profiler it’s relatively low on performance utilization)

Building a temp tile engine next, possibly will move this over to the Developer Support thread. It’s almost as if Corona is caching something and when you move your finger the cache fails. [import]uid: 41884 topic_id: 29119 reply_id: 117174[/import]

Finally ruled out Lime. Details in this Developer Support thread. [import]uid: 41884 topic_id: 29119 reply_id: 117217[/import]