[erlang-questions] documentation of data structures

Lev Walkin <>
Tue Dec 11 13:59:44 CET 2007


Matej Kosik wrote:

>> If Erlang is implemented properly, this would be efficient despite the
>> fact that there are many
>> processes. Real measurements would either support or reject such
>> hypothesis.
>>
>>> This design has the same drawback as ets: lots of copying [between
>>> processes]. Consequently, a part of my email still applies:
> 
> Are you sure? When (in which kind of operation) would such copying (of what) be needed.
> 
> Sure, the cost of explicit copying of a queue instance has O(len(N)) complexity. But we were talking
> about adding/removing elements at the head/tail of the queue.

I suspect implementing a queue as a separate process would have
larger constant factor than the current queues implementation for
data of pretty much any size. With larger elements the cost
of copying between processes only increases (unless they contain
larger binaries, of course).

So I see no point in implementing queues as an external data
structure, since there's going to be no performance benefit,
or more properly put, they'll have a negative performance impact.

-- 
Lev Walkin




More information about the erlang-questions mailing list