## The performance of Haskell CONTAINERS package

### Cached

### Download Links

### BibTeX

@MISC{Straka_theperformance,

author = {Milan Straka},

title = {The performance of Haskell CONTAINERS package},

year = {}

}

### OpenURL

### Abstract

In this paper, we perform a thorough performance analysis of the CONTAINERS package, a de facto standard Haskell containers library, comparing it to the most of existing alternatives. 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.

### Citations

257 | The standard template library
- Stepanov, Lee
- 1994
(Show Context)
Citation Context ...focus on the high level development, • prevent bugs in the data structure implementation, • can provide high performance. For some languages, standardized data structure libraries exist (STL for C++ [=-=Stepanov and Lee 1994-=-], Java Collections Framework, .NET System.Collections, etc.), which provide common and effective option in many cases. Being the only data structure package coming with GHC and the Haskell Platform (... |

255 | Making data structures persistent
- Driscoll, Sarnak, et al.
- 1989
(Show Context)
Citation Context ...), • maps of key and value pairs (the keys must be comparable), • ordered sequences of any elements, • trees and graphs. All data structures in this package work persistently, ie. they can be shared [=-=Driscoll et al. 1989-=-]. Our decision to compare and improve the CONTAINERS package was motivated not only by the wide accessibility of the package, but also by our intention to replace the GHC internal data structures wit... |

242 | Purely Functional Data Structures
- Okasaki
- 1996
(Show Context)
Citation Context ...he CONTAINERS package, which implements 2-3 finger trees annotated with sizes [Hinze and Paterson 2006], • Trivial, which is a non-persistent queue with amortized bounds, described in Section 5.2 of [=-=Okasaki 1999-=-], • Amortized, which is a persistent queue with amortized bounds, described in Section 6.3.2 of [Okasaki 1999], 10/rnd_b 10/rnd_p 10/rnd_u Figure 8. Benchmark of queue operations • Realtime, which is... |

240 |
A dichromatic framework for balanced trees
- Guibas, Sedgewick
- 1978
(Show Context)
Citation Context ...[Adelson-Velskii and Landis 1962], • AVL from TREESTRUCTURES package, which we denote as AVL2 in the benchmarks, also using AVL trees, • RBSet implemented by us which uses well-known red-black trees [=-=Guibas and Sedgewick 1978-=-]. We performed these benchmarks: • lookup benchmark: perform a member operation on every element of the given set, either in ascending order (asc in the input description) or in random order of eleme... |

69 | C--: A Portable Assembly Language that Supports Garbage Collection
- Jones, Ramsey, et al.
- 1999
(Show Context)
Citation Context ...ferences at the level of Core Haskell [Tolmach 2001] using for example the -ddump-stranal GHC flag, which shows the results of strictness analysis. If this is not enough, we can examine the C-- code [=-=Jones et al. 1999-=-] using the -ddump-cmm GHC flag. We had to resort to analysis on all these levels when improving the performance of the CONTAINERS. We now briefly describe the changes we made to improve the performan... |

33 |
The art of computer programming, volume 3: (2nd ed.) sorting and searching
- Knuth
- 1998
(Show Context)
Citation Context ...do better on average, by developing a new impelementation for set/map optimised for the expensivecomparison case. Two approaches suggest themselves. First, one could use a hash table (Section 6.4 of [=-=Knuth 1998-=-]) to guess the position of an element in the set and performs only one comparison if the guess was correct. Another alternative is a trie (Section 6.3 of [Knuth 1998]), which can also be implemented ... |

27 |
An algorithm for the organization of information. Doklady Akademii Nauk SSSR
- Adel'son-Vel'skii, Landis
- 1962
(Show Context)
Citation Context ...e, which uses bounded balance trees [Adams 1993], • FiniteMap from GHC 6.12.2 sources, which also uses bounded balance trees [Adams 1993], • AVL from AVLTREE package, which uses well-known AVL trees [=-=Adelson-Velskii and Landis 1962-=-], • AVL from TREESTRUCTURES package, which we denote as AVL2 in the benchmarks, also using AVL trees, • RBSet implemented by us which uses well-known red-black trees [Guibas and Sedgewick 1978]. We p... |

24 | Fast mergeable integer maps
- Okasaki, Gill
- 1998
(Show Context)
Citation Context ...entations exploit the fact that anInt is a sequence of 32 or 64 bits. We have benchmarked following intset implementations: • IntSet from CONTAINERS package which implements bigendian Patricia trees [=-=Okasaki and Gill 1998-=-], • UniqueFM from GHC 6.12.2 sources which implements also big-endian Patricia trees, • PatriciaLoMap fromEdisonCore package, calledEdisonMap in the benchmark, which implements little-endian Patricia... |

19 | Finger trees: a simple general-purpose data structure - Hinze, Paterson |

18 |
Efficient sets: a balancing act
- Adams
- 1993
(Show Context)
Citation Context ...ibe the algorithms used, but will provide references for interested readers. We benchmarked the following set implementations: • Set and Map from CONTAINERS package, which uses bounded balance trees [=-=Adams 1993-=-], • FiniteMap from GHC 6.12.2 sources, which also uses bounded balance trees [Adams 1993], • AVL from AVLTREE package, which uses well-known AVL trees [Adelson-Velskii and Landis 1962], • AVL from TR... |

14 |
Tenary Search Trees
- Bentley, Sedgewick
- 1998
(Show Context)
Citation Context ... element in the set and performs only one comparison if the guess was correct. Another alternative is a trie (Section 6.3 of [Knuth 1998]), which can also be implemented using a ternary search tree ([=-=Bentley and Sedgewick 1998-=-]), which compares only subparts of elements. The problem with a hash table is that it is usually built using an array, but there is no available implementation of an array that could be shared, ie. b... |

1 |
Low level virtual machine for glasgow haskell compiler
- Terei
- 2009
(Show Context)
Citation Context ...s quite significant slowdown in the case Haskell generating the hashing code. We discussed this with the GHC developers and were informed that the problem should be solved using the new LLVM backend [=-=Terei 2009-=-]. We also performed the union benchmark. We generated a sequence of elements (its length is the first part of the input description) and created two sets of the same size, one from the elements on th... |