All tests are performed on int
keys and values currently.
Benchmarks are done using BenchmarkDotNet
HashMapOkasaki
is an implementation inspired by Fast Mergeable Integer Maps by Chris Okasaki and Andrew GillImmutableDictionary
is the ImmutableDictionary fromSystem.Collections.Immutable
FSharpX
usesPersistentHashMap
from FSharpx.CollectionsFSharpMap
is the standard search tree implementation from FSharp.Core which is not really comparable but gives us a clue where the implementation standsHAMT
is the V5 implementation from HAMT.NETImTools
is theImHashMap
implementation from ImTools
Judging by the current benchmarks, the HashMapOkasaki
implementation supports the fastest modification times and also shows lookup-times comparable to the fastest implementations. The only other alternative showing similar results is the ImTools
implementation at the moment.
Note that the HashMapOkasaki
doesn't use System.Runtime.Intrinsics.X86
at the moment (since I wasn't able to run the HAMT
benchmarks on netcore3) so the lookup performance might improve a little when using these.