This a suite of very high-performance immutable-collections
- For lists you should always prefer to use
Seq<A>
- it is about 10x faster thanLst<A>
. The only reason you'd pickLst<A>
is if you needed to do inserts into the middle of the list:Seq<A>
doesn't allow this (it only allows prepending or appending), as it would be a performance hit.Seq<A>
is backed by an array, and so it has exceptional memory locality,Lst<A>
is an AVL tree to allow for efficient
insertion, but suffers from poorer memory locality. - For 'dictionaries' or maps as we prefer to call them, then
HashMap
is the fastest implemention you'll find in .NET-land. It is unsorted. If you need a sorted dictionary, useMap
.HashMap
uses the CHAMP data-structure,Map
uses an AVL tree. - The same goes for sets, prefer
HashSet
overSet
, unless you need the set to be sorted.