Friday, March 9, 2012

Improvements to HashMap and HashSet creation

I mentioned in my last post that I'd like to improve the performance of fromList for all types exported by the unordered-containers package. Twan van Laarhoven beat me to it and his changes, together with some additional optimizations by me, made for quite a nice speed-up:

(fromListWith should also see similar improvements.)

The improvements are in the unordered-containers-0.2.0.1 release.

I also plan to add additional functions e.g. unfoldr and unfoldrM that will allow efficient bulk creation of maps and sets. For example, unfoldrM will let you efficiently create a map (or set) from the content of a file.

No comments:

Post a Comment