Thoughts on laziness (long)

Ulf Wiger etxuwig@REDACTED
Thu Oct 19 16:18:59 CEST 2000


On Thu, 19 Oct 2000 matthias@REDACTED wrote:

>* Every attempt I've seen to build a clever, general data structure in
>  Erlang has resulted in something that's slower than either lists or
>  ETS. Two examples:

I suspect that it's hard to beat plain lists on the "sum" benchmark,
but then again, lists suck badly on the "update" benchmark, as does
ets on "sum". So the niche of alternative structures would be to
strike a good compromise between the two.

>Reasons why the above tests might be complete crap:
>
>   - The above benchmark might be contrived specially to make
>     ETS look good. Then again, with such small tuples, I think
>     it's a worst-case for ETS.

Actually, I think it's the other way around. In my experience, having
built a linear hashing table in Erlang, for example, ets scales better
with an increasing number of objects, but loses to a heap-based
implementation when the objects get large. For small objects, it's
very difficult to beat ets, but with > 1KBytes/object, you stand a
good chance.

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Strategic Product & System Management        mob: +46 70 519 81 95
Ericsson Telecom AB,              Datacom Networks and IP Services
Varuvägen 9, Älvsjö,                    S-126 25 Stockholm, Sweden





More information about the erlang-questions mailing list