Skip to content

krauthaufen/ImmutableHashCollections

Repository files navigation

Benchmarks

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 Gill
  • ImmutableDictionary is the ImmutableDictionary from System.Collections.Immutable
  • FSharpX uses PersistentHashMap from FSharpx.Collections
  • FSharpMap is the standard search tree implementation from FSharp.Core which is not really comparable but gives us a clue where the implementation stands
  • HAMT is the V5 implementation from HAMT.NET
  • ImTools is the ImHashMap implementation from ImTools

Results

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.

About

Benchmarks for different persistent HashMap implementations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published