Fw: Messages between processes

Wiger Ulf ulf.wiger@REDACTED
Mon Dec 30 21:48:22 CET 2002


The time saved when sending messages between different nodes would be
insignificant, since you would only save a few microseconds at most on the
message encode/decode -- this is nothing compared to the total cost of
distributed messaging.

The only time it really makes sense to pass around messages as binaries is
if they originated as binaries. This would be typical for some protocol
applications, where a message arrives from the network in some
well-specified binary form. A first recipient could do a partial decode of
the message in order to determine where it should go next, and then pass the
original message along. This would be more efficient than decoding the
entire message first, and then sending a (perhaps big) erlang term -- partly
because some messages can be discarded early, or off-loaded to another
processor early, and partly because passing binary payload in a local
message is very cheap. The downside is that it complicates the application
somewhat.

As a general rule, converting data to binary format in order to shave a
little time off the message passing is a sub-optimization. Very much so with
Shared Heap Erlang, since all local messages (not just binary messages) are
passed by pointer reference.

/Uffe

----- Original Message -----
From: "Inswitch Solutions - Erlang Evaluation" <erlang@REDACTED>
To: <erlang-questions@REDACTED>
Sent: den 31 december 2002 16:42
Subject: Re: Fw: Messages between processes


>
> So sending messages using binary types between different Nodes (different
> machines) does not have better performance ?
>
> Thank you,
> Eduardo Figoli
> INSwitch Solutions
>
>
> ----- Original Message -----
> From: "Klacke" <klacke@REDACTED>
> To: "Inswitch Solutions - Erlang Evaluation" <erlang@REDACTED>
> Cc: <erlang-questions@REDACTED>
> Sent: Monday, December 30, 2002 6:41 PM
> Subject: Re: Fw: Messages between processes
>
>
> > On Tue, Dec 31, 2002 at 01:55:07PM +0100, Inswitch Solutions - Erlang
> Evaluation wrote:
> > >
> > > When sending messages with parameters, between processes, should
> > > be better to send them (the params) in binary form ?
> > >
> >
> > No,
> >
> > The only possible exception where it would be (possibly) faster
> > would be long strings of characters and use list_to_binary/1.
> >
> >
> > /klacke
> >
> > --
> > Claes Wikstrom                        -- Caps lock is nowhere and
> > Alteon WebSystems                     -- everything is under control
> > http://www.bluetail.com/~klacke
> > cellphone: +46 70 2097763
>




More information about the erlang-questions mailing list