Theory and Practice of Chunked Sequences
Sequence data structures, i.e., data structures that provide operations on an ordered set of items, are heavily used by many applications. For sequence data structures to be efficient in practice, it is important to amortize expensive data-structural operations by chunking a relatively small, constant number of items together, and representing them by using a simple but fast (at least in the small scale) sequence data structure, such as an array or a ring buffer. In this paper, we present chunking techniques, one direct and one based on bootstrapping, that can reduce the practical overheads of sophisticated sequence data structures, such as finger trees, making them competitive in practice with specialpurpose data structures. We prove amortized bounds showing that our chunking techniques reduce runtime by amortizing expensive operations over a user-defined chunk-capacity parameter. We implement our techniques and show that they perform well in practice by conducting an empirical evaluation. Our evaluation features comparisons with other carefully engineered and optimized implementations.
Unable to display preview. Download preview PDF.
- 1.Acar, U.A., Charguéraud, A., Rainey, M.: Theory and practice of chunked sequences, http://deepsea.inria.fr/chunkedseq (full version)
- 2.Bernardy, J.-P.: The Haskell yi package, http://hackage.haskell.org/package/yi-0.6.2.3/docs/src/Data-Rope.html
- 4.Buchsbaum, A.L.: Data-structural bootstrapping and catenable deques. PhD thesis, Princeton University (1993)Google Scholar
- 5.Stanford Large Network Dataset Collection. Friendster graph, http://snap.stanford.edu/data/com-Friendster.html
- 6.Dietz, P.F.: Maintaining order in a linked list. In: STOC 1982, Baltimore, USA, pp. 122–127. ACM Press (May 1982)Google Scholar
- 7.Guibas, L.J., McCreight, E.M., Plass, M.F., Roberts, J.R.: A new representation for linear lists. In: STOC 1977, pp. 49–60. ACM, New York (1977)Google Scholar
- 9.Kaplan, H., Tarjan, R.E.: Persistent lists with catenation via recursive slow-down. In: TOC 1995, pp. 93–102. ACM (1995)Google Scholar
- 10.Kaplan, H., Tarjan, R.E.: Purely functional representations of catenable sorted lists. In: STOC 1996, pp. 202–211. ACM, New York (1996)Google Scholar
- 11.Knuth, D.E.: The Art of Computer Programming: Sorting and Searching, 2nd edn., vol. 3, ch. 6, pp. 481–489. Addison-Wesley (1998)Google Scholar
- 12.Leiserson, C.E., Schardl, T.B.: A work-efficient parallel breadth-first search algorithm. In: SPAA 2010, pp. 303–314 (June 2010)Google Scholar
- 13.SGI. Stl rope, http://www.sgi.com/tech/stl/Rope.html
- 14.Stepanov, A., Lee, M.: The Standard Template Library, volume 1501. HP Laboratories (1995)Google Scholar