I'm testing a 2D OpenGL ES based iPhone game on both the iPhone 3G and the iPhone 4. It runs great on the iPhone 4... and pretty well on the 3G. The game state is updated at 60 Hz... and the rendering is done at 60 fps. Would the following conversion from Objective-C to c improve the performance at all?
// current Objective-C function
- (void) updateSomething {
// simple update like x_position += 2.0;
}
// plain c function
void updateSomething(){
// simple update like x_position += 2.0;
}
Assume these functions are called at a rate of 60 Hz. The reason I'm curious is this blog post. The author mentions substantial performance improvements when making a similar conversion.
Cheers!
Edit: after running w/ the CPU Sampler instrument in XCode it looks like about 65% of the function calls are to mach_msg_trap. objc_msgSend apparently takes up a trivial amount of resources.