Bypassing Objective-C's Message Passing Mechanism for Speed

hohlecow: “When possible, I like to use Objective-C for its pure encapsulation. The convenience of message passing in Objective-C, however, can be a performance hinderance when calling methods several thousand times in succession. Thankfully, there are several options for getting great performance out of critical code paths in Objective-C applications.” (Via Jim Roepcke.)

I hesitate to point to things like this, however interesting, because people get the idea that grown-up Objective-C programming is like this. It’s not. It’s important to understand your environment and know what’s possible, but in most real-world cases this is not the type of optimization a Cocoa program needs. (I say most, but not all, of course.)

27 May 2008


© 1995-2014 Ranchero Software, LLC