My program is spending most of its time in objc_msgSend. Does that mean that Objective-C has bad per

Posted by Paperflyer on Stack Overflow See other posts from Stack Overflow or by Paperflyer
Published on 2010-05-11T15:03:46Z Indexed on 2010/05/11 15:24 UTC
Read the original article Hit count: 210

Filed under:
|
|
|

Hello Stackoverflow.

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.

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 objc_msgSend (mostly in drawing related system calls).

On the one hand, I am glad about this since it means that my 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 (objc_msgSend). Hence, that if I had written the application in, say, Carbon, its performance would be drastically better.

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.

So, is Objective-C really a language with bad performance? What do you think about that?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c