skip to main content
10.1145/2993236.2993251acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
short-paper

Towards a software product line of trie-based collections

Published:20 October 2016Publication History

ABSTRACT

Collection data structures in standard libraries of programming languages are designed to excel for the average case by carefully balancing memory footprint and runtime performance. These implicit design decisions and hard-coded trade-offs do constrain users from using an optimal variant for a given problem. Although a wide range of specialized collections is available for the Java Virtual Machine (JVM), they introduce yet another dependency and complicate user adoption by requiring specific Application Program Interfaces (APIs) incompatible with the standard library.

A product line for collection data structures would relieve library designers from optimizing for the general case. Furthermore, a product line allows evolving the potentially large code base of a collection family efficiently. The challenge is to find a small core framework for collection data structures which covers all variations without exhaustively listing them, while supporting good performance at the same time.

We claim that the concept of Array Mapped Tries (AMTs) embodies a high degree of commonality in the sub-domain of immutable collection data structures. AMTs are flexible enough to cover most of the variability, while minimizing code bloat in the generator and the generated code. We implemented a Data Structure Code Generator (DSCG) that emits immutable collections based on an AMT skeleton foundation. The generated data structures outperform competitive hand-optimized implementations, and the generator still allows for customization towards specific workloads.

References

  1. V. Alves, D. Schneider, M. Becker, N. Bencomo, and P. Grace. “Comparitive Study of Variability Management in Software Product Lines and Runtime Adaptable Systems”. In: Proceedings of VaMoS ’09. Universität Duisburg-Essen, 2009.Google ScholarGoogle Scholar
  2. P. Bagwell. Fast And Space Efficient Trie Searches. Tech. rep. LAMP-REPORT-2000-001. Ecole polytechnique fédérale de Lausanne, 2000.Google ScholarGoogle Scholar
  3. P. Bagwell. Ideal Hash Trees. Tech. rep. LAMPREPORT-2001-001. Ecole polytechnique fédérale de Lausanne, 2001.Google ScholarGoogle Scholar
  4. P. Bagwell and T. Rompf. RRB-Trees: Efficient Immutable Vectors. Tech. rep. EPFL-REPORT-169879.Google ScholarGoogle Scholar
  5. Ecole polytechnique fédérale de Lausanne, 2011.Google ScholarGoogle Scholar
  6. T. J. Biggerstaff. “A Perspective of Generative Reuse”. In: Annals of Software Engineering 5.1 (1998). Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Bird. “Two Dimensional Pattern Matching”. In: Information Processing Letters 6.5 (1977).Google ScholarGoogle ScholarCross RefCross Ref
  8. R. de la Briandais. “File Searching Using Variable Length Keys”. In: Proceedings of IRE-AIEE-ACM ’59 (Western). ACM, 1959. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Clements and L. Northrop. Software Product Lines: Practices and Patterns. Addison-Wesley, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. K. Czarnecki and U. W. Eisenecker. Generative Programming: Methods, Tools, and Applications. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. van Deursen and P. Klint. “Domain-Specific Language Design Requires Feature Descriptions”. In: Journal of Computing and Information Technology 10.1 (2002).Google ScholarGoogle ScholarCross RefCross Ref
  12. J. R. Driscoll, N. Sarnak, D. D. Sleator, and R. E. Tarjan. “Making Data Structures Persistent”. In: Proceedings of STOC ’86. ACM, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Fredkin. “Trie Memory”. In: Communications of the ACM 3.9 (1960). Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Hallsteinsen, M. Hinchey, S. Park, and K. Schmid. “Dynamic Software Product Lines”. In: Computer 41.4 (2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P. Hawkins, A. Aiken, K. Fisher, M. Rinard, and M. Sagiv. “Concurrent Data Representation Synthesis”. In: Proceedings of PLDI ’12. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. Hawkins, A. Aiken, K. Fisher, M. Rinard, and M. Sagiv. “Data Representation Synthesis”. In: Proceedings of PLDI ’11. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Helland. “Immutability Changes Everything”. In: Communications of the ACM 59.1 (2015). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Klint, T. van der Storm, and J. Vinju. “Rascal: A Domain Specific Language for Source Code Analysis and Manipulation”. In: Proceedings of SCAM ’09. IEEE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Loncaric, E. Torlak, and M. D. Ernst. “Fast Synthesis of Fast Collections”. In: Proceedings of PLDI ’16. ACM, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. McIlroy. “Mass-Produced Software Components”. In: Proceedings of NATO Software Engineering Conference. Scientific Affairs Division, NATO, 1969.Google ScholarGoogle Scholar
  21. C. Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Prokopec, N. G. Bronson, P. Bagwell, and M. Odersky. “Concurrent Tries with Efficient Non-blocking Snapshots”. In: Proc. of PPoPP ’12. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. E. Schonberg, J. T. Schwartz, and M. Sharir. “Automatic Data Structure Selection in SETL”. In: Proceedings of POPL ’79. ACM, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. O. Shacham, M. Vechev, and E. Yahav. “Chameleon: Adaptive Selection of Collections”. In: Proceedings of PLDI ’09. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Y. Smaragdakis and D. Batory. “DiSTiL: A Transformation Library for Data Structures”. In: Proceedings of DSL’97. USENIX Association, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. J. Steindorfer. Towards a Feature Model of Trie-Based Collections. 2016.Google ScholarGoogle Scholar
  27. DOI : 10. 5281 / zenodo. 59739.Google ScholarGoogle Scholar
  28. M. J. Steindorfer and J. J. Vinju. “Code Specialization for Memory Efficient Hash Tries (Short Paper)”. In: Proceedings of GPCE ’14. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. M. J. Steindorfer and J. J. Vinju. “Fast and Lean Immutable Multi-Maps on the JVM based on Heterogeneous Hash-Array Mapped Tries”. In: ArXiv e-prints (2016). arXiv: 1608.01036 {cs.DS}.Google ScholarGoogle Scholar
  30. M. J. Steindorfer and J. J. Vinju. “Optimizing Hasharray Mapped Tries for Fast and Lean Immutable JVM Collections”. In: Proceedings of OOPSLA ’15. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. J. Steindorfer and J. J. Vinju. “Performance Modeling of Maximal Sharing”. In: Proceedings of ICPE ’16. ACM, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. N. Stucki, T. Rompf, V. Ureche, and P. Bagwell. “RRB Vector: A Practical General Purpose Immutable Sequence”. In: Proceedings of ICFP ’15. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. V. Ureche, C. Talau, and M. Odersky. “Miniboxing: Improving the Speed to Code Size Tradeoff in Parametric Polymorphism Translations”. In: Proceedings of OOPSLA ’13. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Introduction Related Work A Stable Data Type Independent Encoding Intermediate Generator Abstractions ConclusionGoogle ScholarGoogle Scholar

Index Terms

  1. Towards a software product line of trie-based collections

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                GPCE 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
                October 2016
                212 pages
                ISBN:9781450344463
                DOI:10.1145/2993236

                Copyright © 2016 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 20 October 2016

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • short-paper

                Acceptance Rates

                Overall Acceptance Rate56of180submissions,31%

                Upcoming Conference

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader