I have been working on a game for quite a while and started to get into performance issues. The game has 4 levels:
(1) platform scene - player moves up - collects 4 power ups and there is only 1 enemy robot (chipmunk)
(2) spaceship scene where background scrolls - about 6 different enemies.
(3) walking scene where accelerometer moves box2d body to the right inside a large (maybe 10,000 px long ground container) (box2d)
(4) car scene controlled by accelerometer and individually laid down ground pieces until end is reached.
Problem is in scene 1.
A) I started running it on the device and xcode showed FPS of 12.
B) Ran it on device with time profile and it showed up that sprite draw and texture draw were consuming a lot of time. I tried removing some sprites but nothing changed.
C) A few hours later, ran it again on the device with time profile but the game was NOT glitchy.
D) This morning I ran it on device again and it ran glitchy as yesterday.
E) So i used xcode GL analyzer after seeing 12 FPS again, and got the screen i posted on chipmunk.
F) Now without removing anything at all, I ran on device with time profile and its working fine again!
I made a post here in Chipmunk forums because I thought it was a chipmunk issue but now Im not so sure:
http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2476&p=10947#p10947
What else can I do to test it? I dont consider having too many sprites...not more than ive seen in other games.