The Performance of the Haskell Containers Package


Abstract:

In this paper, we perform a thorough performance analysis of the containers package, the de facto standard Haskell containers library, comparing it to the most of existing alternatives on HackageDB. We then significantly improve its performance, making it comparable to the best implementations available. Additionally, we describe a new persistent data structure based on hashing, which offers the best performance out of available data structures containing Strings and ByteStrings.

The paper was presented at Haskell Symposium 2010. The draft paper is available as PDF.

Additionally, several related materials are here.

You can find here the graphs from the paper, and also the variant using seq instead of a fold to evaluate the resulting data structure.

The patches has been merged to the main containers repository.

The original benchmark is here, with the .csv results included. The benchmark itself is not developed any more, not well documented and its architecture is not very elegant. It is completely self-contained, needs only GHC 6.12.1 or similar to run.

A new benchmark for the containers package is available on the Hackage as containers-benchmark.


Back