I'm working on a 2D platformer using cocos2d. I have my level split up into several 320x320 sprites and then a 5 frame animation for my character. My performance seems to be locked in at 20 fps which seems really low to me. Once I start moving around and loading new parts of the level, frame rate drops to 1 or 2 fps during the loading and then returns to around 12 fps once things calm down. When I remove the background sprites and just draw the character, frame rate varies from 35 to 45 fps. The animation is done from a sprite sheet, so I'm not sure why running this one animation is that slow even. Instruments shows most of my time spent on swapbuffers, with time spent on [CCNode visit] being minimal, and time spent in tick as not so much either. I've checked to make sure that I have thumb mode turned off. I know I should probably be using sprite sheets for the background as well, but I'm still working out how to do this since the overall size of the level is much larger than the maximum texture size and I'm having to load blocks dynamically. I tried using 16-bit textures, but it looks awful and honestly didn't result in any performance increase.
Also interesting, and I know I shouldn't do any performance testing on the simulator, but I did find this to be strange. I'm testing on a 3G right now, but the simulator locks in at that same 20 fps. Without the background it gets back up to 60 fps. It makes me wonder though if there is something in my code for those background sprites that is capping my frame rate. I've looked through my code pretty carefully, and I can't find anything that I would think would do that. My only code that seems to be time consuming is that dynamic loading for the background sprites, and that doesn't get called unless the character has moved from the starting point a little ways. My iPhone 4 should be getting in pretty soon, so I'm looking forward to seeing what performance differences that makes.