Conc-Trees for Functional and Parallel Programming
Parallel algorithms can be expressed more concisely in a functional programming style. This task is made easier through the use of proper sequence data structures, which allow splitting the data structure between the processors as easily as concatenating several data structures together. Efficient update, split and concatenation operations are essential for declarative-style parallel programs.
This paper shows a functional data structure that can improve the efficiency of parallel programs. The paper introduces two Conc-Tree variants: the Conc-Tree list, which provides worst-case \(O(\log n)\) time lookup, update, split and concatenation operations, and the Conc-Tree rope, which additionally provides amortized O(1) time append and prepend operations. The paper demonstrates how Conc-Trees implement efficient mutable sequences, evaluates them against similar persistent and mutable data structures, and shows up to \(3 \times \) performance improvements when applying Conc-Trees to data-parallel operations.
- 2.Allen, E., Chase, D., Hallett, J., Luchangco, V., Maessen, J.W., Ryu, S., Steele, G., Tobin-Hochstadt, S.: The Fortress Language Specification. Technical report, Sun Microsystems Inc., (2007)Google Scholar
- 3.Bagwell, P.: Fast Functional Lists. Deques, and Variable Length Arrays. Technical report, Hash-Lists (2002)Google Scholar
- 4.Bagwell, P., Rompf, T.: RRB-Trees: Efficient Immutable Vectors. Technical report (2011)Google Scholar
- 7.Kaplan, H., Tarjan, R.E.: Persistent lists with catenation via recursive slow-down. In: STOC 1995, pp. 93–102. ACM, New York, NY, USA (1995)Google Scholar
- 8.Kaplan, H., Tarjan, R.E.: Purely functional representations of catenable sorted lists. In: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, STOC 1996, pp. 202–211. ACM, New York, NY, USA (1996)Google Scholar
- 9.Okasaki, C.: Purely Functional Data Structures. Ph.D. thesis, Pittsburgh, PA, USA, AAI9813847 (1996)Google Scholar
- 10.Okasaki, C.: Catenable double-ended queues. In: Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming, pp. 66–74. ACM Press (1997)Google Scholar
- 12.Prokopec, A.: Data Structures and Algorithms for Data-Parallel Computing in a Managed Runtime. Ph.D. thesis, EPFL (2014)Google Scholar
- 14.Prokopec, A., Bronson, N.G., Bagwell, P., Odersky, M.: Concurrent tries with efficient non-blocking snapshots. In: PPopp 2012, pp. 151–160. ACM, New York, NY, USA (2012)Google Scholar
- 15.Prokopec, A., Petrashko, D., Odersky, M.: On Lock-Free Work-stealing Iterators for Parallel Data Structures. Technical report (2014)Google Scholar
- 16.Steele, G.: Organizing functional code for parallel execution; or, foldl and foldr considered slightly harmful. In: International Conference on Functional Programming (ICFP) (2009)Google Scholar