title: My program is spending most of its time in objc_msgSend. Does that mean that Objective-C has bad performance?
body: <p>I have written an application that has a number of custom views and generally draws a lot of lines and bitmaps. Since performance is somewhat critical for the application, I spent a good amount of time optimizing draw performance.</p>
  
  <p>Now, activity monitor tells me that my application is usually using about 12% CPU and Instrument (the profiler) says that a whopping 10% CPU is spent in <code>objc_msgSend</code> (mostly in drawing related system calls).</p>
  
  <p>On the one hand, I am glad about this since it means that <em>my</em> drawing is about as fast as it gets and my optimizations where a huge success. On the other hand, it seems to imply that the only thing that is still using my CPU is the Objective-C overhead for messages (<code>objc_msgSend</code>). Hence, that if I had written the application in, say, Carbon, its performance would be drastically better.</p>
  
  <p>Now I am tempted to conclude that Objective-C is a language with bad performance, even though Cocoa seems to be awfully efficient since it can apparently draw faster than Objective-C can send messages.</p>
  
  <p>So, is Objective-C really a language with bad performance? What do you think about that?</p>