title: Objective C message dispatch mechanism
body: <p>I am just staring to play around with Objective C (writing toy iPhone apps) and I am curious about the underlying mechanism used to dispatch messages.  I have a good understanding of how virtual functions in C++ are generally implemented and what the costs are relative to a static or non-virtual method call, but I don't have any background with Obj-C to know how messages are sent.  Browsing around I found <a href="http://www.mikeash.com/?page=pyblog/performance-comparisons-of-common-operations.html" rel="noreferrer">this</a> loose benchmark and it mentions IMP cached messages being faster than virtual function calls, which are in turn faster than a standard message send.</p>
  
  <p>I am not trying to optimize anything, just get deeper understanding of how exactly the messages get dispatched.  </p>
  
  <ul>
  <li>How are Obj-C messages dispatched?</li>
  <li>How do Instance Method Pointers get cached and can you (in general) tell by reading the code  if a message will get cached?</li>
  <li>Are class methods essentially the same as a C function (or static class method in C++), or is there something more to them?</li>
  </ul>
  
  <p>I know some of these questions may be 'implementation dependent' but there is only one implementation that really counts.</p>