Usually the performance bottleneck on iOS is related to rendering/fillrate, but from my tests it seems to be from simple code logic. I am testing on an iPod Touch 4.
I am making an extremely simple game, which has about 80 50x50 sprites. If I do nothing to these sprites, the game runs easily at 60 fps.
But if on each update() frame, I try to do something simple to each of them, like change their velocity depending on their position and checking to see if they're onscreen, the framerate drops to about 50fps. I've tried doing this by iterating through the sprites from the PlayState (they are in a FlxTypedGroup), and I've tried extending FlxSprite and adding the logic there (instead of iterating), with the same result.
As another example, there's a point in the game where I run FlxG.collide between 30 sprites (all colliding with each other), and the framerate drops to about 30fps! Just due to the collision logic. If I remove the collisions but keep the sprites the framerate doesn't drop. I realize that colliding 30 sprites corresponds to 900 collision tests, but surely the iPod 4's 800 MHz processor should be able to handle that? The 2.66Ghz processor on my PC can handle 1000 sprites colliding with each other at 60fps (1000000 collision tests), in Flash. And I've developed for iOS before with Cocos2d, and always had lots of processor power to spare (the real issue was always the fillrate).
Are there any known performance issues on iOS, or something I can do to improve performance? Thanks.