[erlang-questions] specs for fixed length lists

Anthony Ramine <>
Tue Jul 10 10:09:19 CEST 2012


I wouldn't be so sure about that, you need to check whether the destructive updates pass (dsetel) does its magic here.

--
Anthony Ramine

Le 10 juil. 2012 à 01:50, Erik Søe Sørensen a écrit :

> Using setelement is a bad idea, at least unless the tuples are very small: the cost in time and allocation is n^2.
> A better scaling approach is to use tuple_to_list + map + list_to_tuple; that should be linear, and my guess is that it'd be faster even for small tuple sizes.
> (For the actual n=4 case, I don't know which is better; must  measure...)
> /Erik



More information about the erlang-questions mailing list