[erlang-questions] Cost of Copy

Henning Diedrich hd2010@REDACTED
Sun May 30 02:44:52 CEST 2010


Hi Johan,

Johan Montelius wrote:
> If we look at larger structures the difference become apparent. 
As per the mailing list, I did a benchmark on this meanwhile.
>
> If we instead represent this as a list of length N we would have to 
> construct a new list to the point where we have located the element 
> that we want to change.
> In average thins means N/2 new list cells for each update. This is for 
> large N more efficient than having to construct a new tuple of size N.
This is something I didn't dig deeper yet, thanks a lot for clarifying 
the difference that lists make.

Thanks a lot for your explanations,
Henning


More information about the erlang-questions mailing list