Thanks for the comments and kind words Shilo!
Ya SpriteKit like many of Apple's frameworks is built on top of C++, this allows them to avoid some of the overhead of Objective-C in the background. This can work really well, but you also really need the framework designed with this in mind. Apple even cheats a little and uses private APIs we don't have access to. It would take some substantial changes to Sparrow to get it to work in a similar way. Instead i've just focused on a few key parts of Sparrow that were eating up time in the 'Time Profiler' and attempted to alleviate them.
ARC is definitely missed, but as long as Sparrow stays in it's own project used as a static library it shouldn't cause any problems for users who use ARC in their own projects.
I ran your SpriteKit project an got these results: (1 run)
[iPhone 5] SpriteKit @ 30fps - 11325 objects
[iPhone 5] SpriteKit @ 60fps - 6525 objects
1st screenshot:
It's best practice to use do-while loops in multi-line macros as it encompasses the code in it's own block. For example:
if (myBool == true)
MY_MULTI_LINE_MACRO();
else
[self doSomethingElse];
This code would not work as expected without the do-while as it would break the if-else statement. The macro also uses a break statement, which makes the do-while required.
2nd screenshot:
They are the same thing, the compiler might even optimize the first one in some way. I haven't looked at the assembly, but there should be no difference. Converting all calls from Objective-C to C isn't easy without drastically changing Sparrows API and losing maintainability, functionality or both. I made C APIs for the Math objects only because they are simple math objects and are used extensively throughout Sparrow.
3rd screenshot:
SPTexture is a factory class so it allocates a separate class and returns that one. In ARC you can just return nil, because ARC is smart enough to release the factory instance. In MRC we have to first release 'self' because it's the factory and then return nil or a newly allocated and initialized class of the correct type. Hence this release and nil of self, before reassigning it or returning.
The SP_* macros are a good idea, i'll go ahead and make that change. Thanks for the input!