Hello all, it's been a while. This week I am working on updating my old (last touched Jan 2012) game. AdWhirl is ending and I needed to change it (and update for iPhone 5 since that is a requirement now). Everything went very smoothly and I found myself with a bit of free time so I decided to do a quick test run of upgrading it to Sparrow 2.0 (using the 'stable' branch from GitHub). The good news is that I was able to get it recompiled and running in about 20 minutes. The biggest problem factors were:
1) Updating to the new block based tween completion system
2) Updating SPLoopType code
3) Getting rid of SPCompiledSprite
4) SXMotionTween
However, here is the bad news. The performance is astonishingly bad for my game (which I admit is poorly written since it was my first Obj-C project ever). The problem is *hugely* CPU-bound (e.g. 34 ms CPU, 5 ms GPU) and it comes entirely from one source: SPTextField. Changes to SPTextField are very very expensive for some reason, and I do a lot of them (color changing text, rapid incrementing slot machine like text, etc). If I try removing the color changing text functionality the frame rate is immediately restored to 60. Is there some new setting on SPTextField that I don't know about? This problem doesn't happen nearly as badly in Sparrow 1.x (45 FPS vs 13 FPS on 3GS, similar performance drop on 5). As an aside, I am not using bitmap fonts for this case (that may well be the problem, but I wonder what makes it worse in Sparrow 2.0)
The culprit is
-[SPGLTexture initWithData:width:height:generateMipMaps:scale:premultipliedAlpha:]
and the hot function is _ZL18getTwiddledAddressjjjj if that helps anything.
Sparrow 1.x ends up calling this instead:
-[SPGLTexture initWithData:properties:]
So I'm guessing something changed between these two versions.
One more change that is tough for me is that reversing loops play at double speed (it seems that the new version does an entire end-to-end playback in the timespan, meaning that I need to double all the tween times to get the same behavior as SPLoopTypeReverse).
I am not going to upgrade this game to Sparrow 2.0, so this isn't an urgent problem but I thought I would let everyone know.