Re: Message Forwarding Overhead / Performance
Re: Message Forwarding Overhead / Performance
- Subject: Re: Message Forwarding Overhead / Performance
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 29 Oct 2008 10:07:07 +0100
Le 29 oct. 08 à 04:46, Michael Ash a écrit :
On Tue, Oct 28, 2008 at 6:16 PM, Jerry Krinock <email@hidden> wrote:
Roughly, the lesson is: Don't use message forwarding for "actual
work". I
was just wondering if anyone had ever found otherwise.
I have to say that this is greatly overstating things. I've used
forwarding for all sorts of real work. What you don't want to do is
put it into a situation where it needs to execute hundreds of
thousands of times a second. But there are a lot of situations which
qualify as "actual work" for which that does not apply.
20us is slow when compared to a normal message send. It's
instantaneous when compared to, say, writing a file to disk. Whether
it's "too slow" depends entirely on what you need.
Mike
And it is heavily used in Cocoa for Distributed object, undo manager,
and probably more.
Anyway, it's premature optimization. If Shark tell you that
forwardlyAdd forwarding: is a bottleneck, just override it in your
parent class to forward the message manually:
- (void)forwardlyAdd:(int)arg {
[forwardee forwardlyAdd:arg];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden