Re: Best way to pass large objects between tasks?
Re: Best way to pass large objects between tasks?
- Subject: Re: Best way to pass large objects between tasks?
- From: Michael Ash <email@hidden>
- Date: Mon, 13 Apr 2009 11:16:25 -0400
On Mon, Apr 13, 2009 at 2:09 AM, Oleg Krupnov <email@hidden> wrote:
> I need to pass objects from one task (child) to another (parent) on
> the same machine.
>
> Currently I am considering two alternatives: Pipes vs Distributed
> Objects, and my main concern is performance, because the object is
> really large.
>
> With pipes, I need to serialize (archive) the object into NSData
> before transmitting, and deserialize (unarchive) back on reception.
> This is going to be very time-taking.
>
> My questions are:
>
> 1) Are DO going to be faster? Do DO also perform implicit
> archiving/unarchiving of passed objects to/from NSData?
DO will serialize certain objects, generally Cocoa collection classes
and things like NSData/NSString. Otherwise it will proxy objects
unless you specifically tell it otherwise. (It *can't* serialize your
custom objects without you telling it that it's ok.)
As for whether it's faster, that depends entirely on what you're
doing. If you're passing a lot of data which will be copied then DO
will be slower, because it just adds overhead. If you're passing a
large tree of proxied objects which will only be lightly queried on
the other side, DO will be faster because it's just going to send
lightweight proxies on demand.
> 2) Are there other ways of passing objects between tasks?
Everything will boil down to either serializing them or proxying them.
There's only one built-in proxying mechanism, DO, and the different
serialization/IPC mechanisms are differentiated more in terms of
capabilities than speed.
Mike
_______________________________________________
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