Erlang标准数据结构的选择

(金庆的专栏)

gen_server with a dict vs mnesia table vs ets
http://stackoverflow.com/questions/2154376/gen-server-with-a-dict-vs-mnesia-table-vs-ets
给出一个按应用类型选择的方法:

Multiple processes on multiple VMs -> mnesia
Multiple processes on one VM -> ets/dets
One process -> bag/dict/...

Frequently Asked Questions about Erlang
February 22 2011
6.2  Is there a collection of data structures, e.g. balanced trees?
http://ftp.sunet.se/pub/lang/erlang/faq/libraries.html#id55214
旧版FAQ中有以下说明:

In practice, Erlang programs use lists (either natively or via dict) for data structures involving up to a few hundred elements and use ETS (the Erlang Term Store) or mnesia for anything larger. ETS uses hashing to allow near constant-time access to almost arbitrarily large amounts of data.

For a collection of data consisting of a few (tens or hundreds) items, lists often outperform both ETS and trees. For large numbers of small items, ETS tends to work best. For larger items, balanced trees can outperform ETS because they avoid copying the data.

但是新版FAQ中删除了以上这些说明,估计新版本中有了变化?

Frequently Asked Questions about Erlang
April 20 2015
6.2  Is there a collection of data structures, e.g. balanced trees?
http://www.erlang.org/faq/libraries.html#idp33085264

Erlang开发建议(杂记版)
http://erlangdisplay.iteye.com/blog/374167
给出了根据规模选择的范围,应该是按旧版FAQ作出的:
Suggestion:
elments count: 0 - 100 | 100 - 10000  |  10000 -
our select   :  list   |      ets     |  gb_tree

04-30 13:02