RegDeveloper posted an article entitled Don’t Forget The ‘C’ in Objective-C!.

The premise of the article is reasonable: Remember that Objective-C has C underpinnings and that a number of common operations using, say, NSString can be orders of magnitude slower than a straight C based implementation.

Absolutely true. However, the article leaves out a critical step.

Measure the damned performance before applying error prone optimizations!

In particular, the article indicates that…

inside the internals of a certain Mac OS X utility – as one does. The programmer in question wanted to use OpenGL effects in his application, and in order to do that, he needed to establish the capabilities of the installed OpenGL system.

The article then goes on to call out the grossly inefficient use of NSString to check for certain OpenGL capabilities.

But, wait, so what? If this test is done once as the OpenGL code is initialized, it won’t even remotely register in terms of CPU cycles used or memory consumed. Bringing up the OpenGL stack, the various rendering buffers, and chunks of texture memory will be orders of magnitude more expensive.

Now, if said NSString based operation were sitting in the middle of a calculate-and-render loop then, sure, it could very likely be problematic. Maybe.

Who knows? Until you actually spend the cycles to measure the performance and determine where the bottlenecks lie, then any optimization is just wild-ass guesswork anyway.

Beware of any optimization article that does not start with analyze performance (or admit up front that it is a useless optimization designed to illustrate what might be useful in a real world situation).

Remember: A bubble sort is perfectly acceptable when sorting a dozen items once upon showing the info panel…. writing hand tuned assembly to solve that problem is simply mental masturbation. Nothing wrong with that until the project deadlines eat you alive.

: link_pages issince version 2.1.0! Use wp_link_pages() instead. inon line