Log in

No account? Create an account
Erlang Index-Based Benchmark - Michael Truog — LiveJournal
Erlang Index-Based Benchmark
I updated the Erlang index-based access benchmark to see how performance is with R14B01 (along with rbdict and aadict). The test was ran 5 times for HiPE and 5 times for non-HiPE installations with the following results:

array (fixed):    get:    5276.8 µs, set:    9489.4 µs
array (dynamic):  get:    5172.0 µs, set:    9616.6 µs
tuple:            get:     988.2 µs, set:  246523.8 µs
gb_trees:         get:    7245.0 µs, set:   67204.2 µs
rbdict:           get:    6379.8 µs, set:   21416.0 µs
aadict:           get:    6438.0 µs, set:   28434.4 µs
orddict:          get: 1632134.8 µs, set:    2214.6 µs
dict:             get:    4980.2 µs, set:   30754.8 µs

array (fixed):    get:       5.3, set:       4.3
array (dynamic):  get:       5.2, set:       4.3
tuple:            get:       1.0, set:     111.3
gb_trees:         get:       7.3, set:      30.3
rbdict:           get:       6.5, set:       9.7
aadict:           get:       6.5, set:      12.8
orddict:          get:    1651.6, set:       1.0
dict:             get:       5.0, set:      13.9

array (fixed):    get:    5188.4 µs, set:    9547.2 µs
array (dynamic):  get:    5164.6 µs, set:    9728.4 µs
tuple:            get:     993.4 µs, set:  256346.2 µs
gb_trees:         get:    6498.6 µs, set:   64902.6 µs
rbdict:           get:    6616.4 µs, set:   21696.6 µs
aadict:           get:    6548.4 µs, set:   27730.0 µs
orddict:          get: 1661093.2 µs, set:    2117.4 µs
dict:             get:    4781.4 µs, set:   30349.0 µs

array (fixed):    get:       5.2, set:       4.5
array (dynamic):  get:       5.2, set:       4.6
tuple:            get:       1.0, set:     121.1
gb_trees:         get:       6.5, set:      30.7
rbdict:           get:       6.7, set:      10.2
aadict:           get:       6.6, set:      13.1
orddict:          get:    1672.1, set:       1.0
dict:             get:       4.8, set:      14.3

The HiPE and non-HiPE results are both very similar. The rbdict, aadict, and gb_trees data structures do have very similar "get" times but the gb_trees data structure "set" time is still a bit slow (compared to rbdict and aadict). The dict implementation has the best "get" times for a tree structure but the "set" times are still a little slower than rbdict and aadict.

If "get" usage dominates, index-based access is always fastest on a tuple (so fixed size array usage might be questionable, unless it involves much "set" usage).

The benchmark results are from Linux version 2.6.32-21, Ubuntu 10.04 with an Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz. My old results are here.

(Updated the HiPE results on 1/2/2011 after a proper Erlang compilation, i.e., when --enable-hipe fails on configure, there is no error)
Leave a comment