Conc-Trees for Functional and Parallel Programming

  • Aleksandar ProkopecEmail author
  • Martin Odersky
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9519)


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.


Data-parallel Operations Time Append Mutable Data Structures Append Node Resizable Array 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Adelson-Velsky, G.M., Landis, E.M.: An algorithm for the organization of information. Dokl. Akad. Nauk SSSR 146, 263–266 (1962)MathSciNetGoogle Scholar
  2. 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. 3.
    Bagwell, P.: Fast Functional Lists. Deques, and Variable Length Arrays. Technical report, Hash-Lists (2002)Google Scholar
  4. 4.
    Bagwell, P., Rompf, T.: RRB-Trees: Efficient Immutable Vectors. Technical report (2011)Google Scholar
  5. 5.
    Boehm, H.J., Atkinson, R., Plass, M.: Ropes: An alternative to strings. Softw. Pract. Exper. 25(12), 1315–1330 (1995)CrossRefGoogle Scholar
  6. 6.
    Hinze, R., Paterson, R.: Finger trees: A simple general-purpose data structure. J. Funct. Program. 16(2), 197–217 (2006)CrossRefMathSciNetzbMATHGoogle Scholar
  7. 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. 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. 9.
    Okasaki, C.: Purely Functional Data Structures. Ph.D. thesis, Pittsburgh, PA, USA, AAI9813847 (1996)Google Scholar
  10. 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
  11. 11.
    Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)CrossRefGoogle Scholar
  12. 12.
    Prokopec, A.: Data Structures and Algorithms for Data-Parallel Computing in a Managed Runtime. Ph.D. thesis, EPFL (2014)Google Scholar
  13. 13.
    Prokopec, A., Bagwell, P., Rompf, T., Odersky, M.: A generic parallel collection framework. In: Jeannot, E., Namyst, R., Roman, J. (eds.) Euro-Par 2011, Part II. LNCS, vol. 6853, pp. 136–147. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  14. 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. 15.
    Prokopec, A., Petrashko, D., Odersky, M.: On Lock-Free Work-stealing Iterators for Parallel Data Structures. Technical report (2014)Google Scholar
  16. 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

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.École Polytechnique Fédérale de LausanneLausanneSwitzerland

Personalised recommendations