Is there any performance gain in calling C code from Objective-C?
I've read somewhere that message passing is slower compared to other languages that use function calling. So if I call a C function from Objective-C code, am I avoiding the messaging overhead?
When optimizing for performance, is it recommended practice to code the most critical functions and procedures in C instead of using Objective-C objects?
EDIT:
Given the amount of answers warning about premature optimization and code readability, I want to clarify that I was not thinking on regular applications, but very specific ones such as:
- Graphics
- Encryption or compression algorithms.
- Maths
And in general, functions or procedures that do not need OO design and are intended to be called many times with parameters.