Instantly share code, notes, and snippets.

Embed
What would you like to do?
Elixir Map/HashDict Performance on Erlang OTP R17 vs R18

Based on tests on my machine (2013 MacBook Pro, 2.6 GHz i7, 16 GB RAM) generated by https://github.com/pragdave/map_performance

Elixir v1.0.4

R17 Results

R18 Results

Raw data:

Erlang OTP R17

insertion
               10     100    1000   10000
        Map     5      68    2313  287033
   HashDict     7      39     463    6682

access
               10     100    1000   10000
     Map        7      32     548   31814
HashDict        8      40     378    4054

Erlang OTP R18

insertion
               10     100    1000   10000
        Map     4      30     174    2491
   HashDict     7      36     449    7038

access
               10     100    1000   10000
     Map        7      32     270    2780
HashDict        8      35     351    3790

Insertion into Elixir.Map. 10 entries
-------------------------------------
Range: from 3 to 2572µs
Median: 5µs
Average: 261.1µs
Insertion into Elixir.Map. 100 entries
--------------------------------------
Range: from 32 to 583µs
Median: 68µs
Average: 114.6µs
Insertion into Elixir.Map. 1000 entries
---------------------------------------
Range: from 2269 to 2668µs
Median: 2313µs
Average: 2377.4µs
Insertion into Elixir.Map. 10000 entries
----------------------------------------
Range: from 270981 to 299640µs
Median: 287033µs
Average: 283263.8µs
Insertion into Elixir.HashDict. 10 entries
------------------------------------------
Range: from 5 to 2138µs
Median: 7µs
Average: 220.6µs
Insertion into Elixir.HashDict. 100 entries
-------------------------------------------
Range: from 36 to 50µs
Median: 39µs
Average: 40.9µs
Insertion into Elixir.HashDict. 1000 entries
--------------------------------------------
Range: from 407 to 654µs
Median: 463µs
Average: 481.3µs
Insertion into Elixir.HashDict. 10000 entries
---------------------------------------------
Range: from 6045 to 8716µs
Median: 6682µs
Average: 6976.8µs
insertion
10 100 1000 10000
Map 5 68 2313 287033
HashDict 7 39 463 6682
Access into Elixir.Map. 10 entries
----------------------------------
Range: from 6 to 1058µs
Median: 7µs
Average: 18.02µs
Access into Elixir.Map. 100 entries
-----------------------------------
Range: from 31 to 45µs
Median: 32µs
Average: 33.2µs
Access into Elixir.Map. 1000 entries
------------------------------------
Range: from 523 to 1223µs
Median: 548µs
Average: 597.18µs
Access into Elixir.Map. 10000 entries
-------------------------------------
Range: from 29553 to 37605µs
Median: 31814µs
Average: 32303.84µs
Access into Elixir.HashDict. 10 entries
---------------------------------------
Range: from 7 to 18µs
Median: 8µs
Average: 8.34µs
Access into Elixir.HashDict. 100 entries
----------------------------------------
Range: from 35 to 53µs
Median: 40µs
Average: 39.48µs
Access into Elixir.HashDict. 1000 entries
-----------------------------------------
Range: from 357 to 837µs
Median: 378µs
Average: 412.83µs
Access into Elixir.HashDict. 10000 entries
------------------------------------------
Range: from 3912 to 6727µs
Median: 4054µs
Average: 4291.62µs
access
10 100 1000 10000
Map 7 32 548 31814
HashDict 8 40 378 4054
Insertion into Elixir.Map. 10 entries
-------------------------------------
Range: from 3 to 2292µs
Median: 4µs
Average: 232.9µs
Insertion into Elixir.Map. 100 entries
--------------------------------------
Range: from 29 to 39µs
Median: 30µs
Average: 31.3µs
Insertion into Elixir.Map. 1000 entries
---------------------------------------
Range: from 155 to 381µs
Median: 174µs
Average: 194.2µs
Insertion into Elixir.Map. 10000 entries
----------------------------------------
Range: from 2356 to 2675µs
Median: 2491µs
Average: 2480.9µs
Insertion into Elixir.HashDict. 10 entries
------------------------------------------
Range: from 5 to 1581µs
Median: 7µs
Average: 164.9µs
Insertion into Elixir.HashDict. 100 entries
-------------------------------------------
Range: from 35 to 41µs
Median: 36µs
Average: 36.6µs
Insertion into Elixir.HashDict. 1000 entries
--------------------------------------------
Range: from 402 to 521µs
Median: 449µs
Average: 459.5µs
Insertion into Elixir.HashDict. 10000 entries
---------------------------------------------
Range: from 5838 to 7491µs
Median: 7038µs
Average: 6794.1µs
insertion
10 100 1000 10000
Map 4 30 174 2491
HashDict 7 36 449 7038
Access into Elixir.Map. 10 entries
----------------------------------
Range: from 7 to 1309µs
Median: 7µs
Average: 20.79µs
Access into Elixir.Map. 100 entries
-----------------------------------
Range: from 30 to 43µs
Median: 32µs
Average: 32.46µs
Access into Elixir.Map. 1000 entries
------------------------------------
Range: from 259 to 561µs
Median: 270µs
Average: 288.41µs
Access into Elixir.Map. 10000 entries
-------------------------------------
Range: from 2702 to 5048µs
Median: 2780µs
Average: 2940.64µs
Access into Elixir.HashDict. 10 entries
---------------------------------------
Range: from 7 to 31µs
Median: 8µs
Average: 9.33µs
Access into Elixir.HashDict. 100 entries
----------------------------------------
Range: from 34 to 57µs
Median: 35µs
Average: 37.43µs
Access into Elixir.HashDict. 1000 entries
-----------------------------------------
Range: from 343 to 435µs
Median: 351µs
Average: 355.22µs
Access into Elixir.HashDict. 10000 entries
------------------------------------------
Range: from 3734 to 5589µs
Median: 3790µs
Average: 3866.14µs
access
10 100 1000 10000
Map 7 32 270 2780
HashDict 8 35 351 3790
@android-programmer

This comment has been minimized.

android-programmer commented Sep 18, 2015

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment