reference comparision

Thomas Raes thomas.raes@REDACTED
Mon Aug 28 12:18:15 CEST 2006


Thanks,

I used references to represent cluster-wide unique datastructures.
The only operation I used them for was checking equality.
However, when I used lots of them (> 100 000), the performance decreased.
This only happened when I used multiple nodes.
The problem disappeared after I changed the references into
{node(),now()}-datastructures.

It seems that checking references for equality is slower than checking
the equality of {node(),now()} -datastructures.
I thought that this might be due to network overhead but maybe the
problem lies somewhere else.

Best regards,

Thomas

Lennart Ohman wrote:
> Hi, the answer is no.
>
> Pids, references and alike has a local unique component and
> a "node-pointer". The "node-pointer" tells a node (having
> received for instance a reference from another node) on which node
> this reference really exists. So any node can compare two references
> and instantly conclude if they are equal or not.
> I do however not know how greater or less comparisons will work
> out. That is if the order will be done on node name (meaning
> that two references will always be sorted the same way regardless
> on which node the comparison is made), or if comparison will be
> made on the "node-pointer" which may very well be a numerically
> different number on two different nodes (having received the
> references from a third node).
> One can on the other hand discus the relevance of doing > and <
> comparisons on a reference...
>
> Best Regards,
> Lennart
>
>
> -------------------------------------------------------------
> Lennart Ohman                   office  : +46-8-587 623 27
> Sjoland & Thyselius Telecom AB  cellular: +46-70-552 67 35
> Sehlstedtsgatan 6               fax     : +46-8-667 82 30
> SE-115 28, STOCKHOLM, SWEDEN    email   : lennart.ohman@REDACTED
>   
>> -----Original Message-----
>> From: owner-erlang-questions@REDACTED [mailto:owner-erlang-
>> questions@REDACTED] On Behalf Of Thomas Raes
>> Sent: Saturday, August 26, 2006 5:08 PM
>> To: erlang-questions@REDACTED
>> Subject: reference comparision
>>
>> Hello,
>>
>> Does comparing references create network traffic to the nodes where the
>> references were created?
>> If so, has anybody an idea how this can be avoided in order to reduce
>> communication overhead between nodes?
>>
>> Best regards,
>>
>> Thomas
>>     
>
>
>
>
>
>   




More information about the erlang-questions mailing list