On 22/02/2008, at 3:00 PM, Hank Heijink wrote:

I made NSInvocations because timing is critical and I didn't want to spend the time constructing the call when it needs to be invoked. I haven't profiled the difference yet though, so maybe the tradeof isn't bad. I'll give it a whirl.

I'm not sure what exactly you're trying to do, but NSInvocation isn't that fast a way of making a call. It's certainly going to somewhat slower than a compiler generated call and it's not NSInvocation's intended use.

If you want fast calls, you should use -[NSObject methodSelector:], cache the result and then call it directly with whatever arguments you want. Make sure you read the documentation to see an example as it usually requires a cast.

Having said that, let me say what has been said many times before, unless you know it's going to be a performance bottleneck, you should be writing your code so that it's as readable/maintainable as possible and then optimise for performance if necessary.

- Chris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to