I'm hoping someone else has experienced this and subsequently found a solution as I am about to light my own hair on fire in frustration.
Simply put, I was creating a Cocos2D app using XCode 3.2.6 and SDK 4.2. I used two devices for testing: iPhone 3GS and iPhone 4, both at IOS 4.2, I believe. When testing on either device I was getting solid 60 FPS performance.
The disaster first hit when I upgraded to XCode 4.2. With no trouble I was able to open my project directly into this new version and run it. Everything is the same except that I am now in XCode 4.2. To my shock and horror I found that I was now getting FPS in the 45 to 50 range, and it will drop into the 30's at times, none of which ever happened before.
At this point I decided to upgrade to Lion, XCode 4.3, and SDK 5.1. Unfortunately, this changed nothing.
I then upgraded both phones to the latest IOS, and still the performance problem continued.
Finally, I upgraded to the latest version of Cocos2D, but to no avail.
I have tried a number of remedies that involved release versus debug modes, compiler settings, etc. Nothing helps.
I found something that might be a hint, but I do not know enough about Open GL ES at this time for it to make a lot of sense. On another forum someone had complained about the very same problem and said that if they disabled Vertex Buffer Object (VBO) support, it resolved the problem. I found where this is enabled within Cocos2D, disabled it, and to my surprise I was back up to 60 FPS. The app does not perform as strong as it did when compiled under XCode 3.2.6, but it is much better with VBO support disabled under XCode 4.3. The problem with this is that disabling VBO support is not recommended as it is suppose to enhance performance when enabled.
Some of the testing I have done seems to point to graphics being the issue. When the app does drop into the 45 FPS range all I have is 12 to 20 sprites moving on the screen. If I remove these sprites and allow everything else to continue operating, I get back to 60 FPS, even with VBO enabled. When I was developing under XCode 3.2.6, I at times would have 100+ sprites moving along (both in view and out) and the the FPS remained at 60.
So in short (sorry, too late for that), does anyone have any idea how the exact same code would run great when compiled through XCode 3.2.6, but rather badly under XCode 4.3? I have tried many different compiler settings to no avail. My guess is that there is some simple setting somewhere that perhaps defaults to a different value between XCode 3 and XCode 4.
Any help would be appreciated.