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:
- Made a version of the app with a .newRect() instead of lime.
- A 32x32 version, still using 48x48px tiles
- A 128x128 version, still using 48x48px tiles
Results?
- 60fps, no drops on any platform
- Smooth enough, can’t tell if it’s dropping. No platform issues
- 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]