[erlang-questions] Benchmarking Erlang: Deathmatch of gb_trees, dict, ets, mnesia ... and registered names

Joel Reymont <>
Thu Oct 9 16:09:21 CEST 2008


On Oct 9, 2008, at 12:24 PM, Ulf Wiger (TN/EAB) wrote:

> The only thing to think about, perhaps, is that global doesn't
> scale well when you add more nodes. If you have only one node,
> it's very fast indeed.


Here are results for 4, 25 and 50 nodes, averages calculated thusly:

populate(N) ->
     populate(N, 0).

populate(0, Avg) ->
     Avg;

populate(N, Avg) ->
     if
         (N rem 10000) == 0 ->
             io:format("Avg: ~.4. f~n", [Avg / 1000000]);
         true ->
             ok
     end,
     {T, {ok, _}} = timer:tc(map8, start, [N]),
     populate(N - 1, (Avg + T) / 2).

It looks like process registration time doubles with the # of nodes.

()3> map8:start_slaves(4).
...
ok
()4> map8:test(100000).
...
Avg: 0.0000
Avg: 0.0017
Avg: 0.0017
Avg: 0.0016
Avg: 0.0019
Avg: 0.0016
Avg: 0.0018
Avg: 0.0016
Avg: 0.0017
Avg: 0.0016
Populate:  170.1915
Avg start: 0.0017
Lookup:    0.0857
ok

()1> map8:start_slaves(25).
...
ok
()2> map8:test(100000).
Avg: 0.0000
Avg: 0.0113
Avg: 0.0105
Avg: 0.0108
Avg: 0.0111
Avg: 0.0105
Avg: 0.0096
Avg: 0.0114
Avg: 0.0110
Avg: 0.0111
Populate:  1031.4716
Avg start: 0.0111
Lookup:    0.0875

()1> map8:start_slaves(50).
...
ok
()2> map8:test(100000).
Avg: 0.0000
Avg: 0.0240
Avg: 0.0220
Avg: 0.0248
Avg: 0.0207
Avg: 0.0234
Avg: 0.0262
Avg: 0.0242
Avg: 0.0237
Avg: 0.0241
Populate:  2393.1143
Avg start: 0.0247
Lookup:    0.0877
ok

--
wagerlabs.com








More information about the erlang-questions mailing list