Search code examples
javascriptperformancecappuccinoobjective-j

Speed comparison of Cappuccinos obj_msgSend() vs. normal JavaScript-call avaiable?


As you know Cappuccino implements the dispatch mechanism of Objective-C / Smalltalk to send messages to objects (~call their methods) in a special method called objj_msgSend.

[someObject someMethodToInvocate: aParameter];

Obviously this introduces some overhead and therefor speed-loss. I'd like to know if somebody can provide a speed comparison between this Message Sending and the normal way to execute a method in JavaScript…

someObject.someMethodToInvocate(aParameter);

Solution

  • objj_msgSend is for my simple tests of pure method calling about 2–2.5 times slower than a direct call.

    That is actually quite good, given the advanced features it makes possible.