I am delighted to announce the release of preview versions of two new packages:
Efficient hashing-based container types.
Efficient hashing of common types.
These packages address a need for faster container types in Haskell, especially for string types like
Text. The package achieves better performance by using hashing and a Patricia trie (also known as a radix tree), instead of a balanced tree, in its implementation.
HashMap type is three times faster than
Data.Map for lookups and twice as fast for inserts, for all key types I've tried, including
I'm calling this a preview release, even though the code has been well tested both for correctness and performance, as the API is quite basic and doesn't provide a
HashSet type yet. One thing you'll notice is that the API is split into a value-strict and a value-lazy version, making it easier to use in a strict setting.
If you want to contribute, please get copies of the source trees from here:
git clone https://github.com/tibbe/unordered-containers.git
git clone https://github.com/tibbe/hashable.git
Alternatively, just fork the projects on GitHub.
As I mentioned in my talk on hashing-based containers earlier this week, I'm working on an even faster version, based on hash-array mapped tries, but it won't be ready until GHC 7.2.