Hello, Being curious about the performance implications of using NSInvocation vs Objective-C message send vs IMP-cached message send, I was surprised to see how much slower NSInvocation seems to be compared to the other two mechanisms (the following data was last collected on Leopard, so these results could have changed in SnowLeopard):
Name Iterations Total time (sec) Time per (ns) IMP-cached message send 1000000000 0.7 0.7 Objective-C message send 1000000000 4.9 4.9 NSInvocation message send 10000000 0.8 77.3 The above metrics can be found here: http://www.mikeash.com/pyblog/performance-comparisons-of-common-operations-leopard-edition.html Cheers, -- Tito On Feb 11, 2011, at 12:20 PM, Joanna Carter wrote: > Hi Matt > >> Consider NSInvocation... m. > > Hmmm, nice! > > My only objection to using it in the circumstances I have is that it is a lot > more code to setup than the idea of a protocol with three methods, > implemented by the target class. > > However, I am indebted to you for pointing out this class and shall remember > it for future use. IMO, this is truly the next best thing to a delegate (as > it is known in C#). > > Joanna > > -- > Joanna Carter > Carter Consulting > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/tciuro%40mac.com > > This email sent to tci...@mac.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com