Implementing Partial Persistence in Object-Oriented Languages

A partially persistent data structure is a data structure which preserves previous versions of itself when it is modified. General theoretical schemes are known (e.g. the fat node method) for making any data structure partially persistent. To our knowledge however no general implementation of these theoretical methods exists to date. This paper evaluates different methods to achieve this goal and presents the first working implementation of partial persistence in the object-oriented language Java. Our approach is transparent, i.e., it allows any existing data structures to become persistent without changing its implementation where all previous solutions require an extensive modification of the code by hand. This transparent property is important in view of the large number of algorithmic results that rely on persistence. Our implementation uses aspect-oriented programming, a modularization technique which allows us to instrument the existing code with the needed hooks for the persistence implementation. The implementation is then validated by running benchmarks to analyze both the cost of persistence and of the aspect oriented approach. We also illustrate its applicability by implementing a random binary search tree and making it persistent, and then using the resulting structure to implement a point location data structure in just a few lines.

[1]  Steven P. Reiss,et al.  Generating Java trace data , 2000, JAVA '00.

[2]  John Hershberger,et al.  Improved Output-Sensitive Snap Rounding , 2006, SCG '06.

[3]  Steven P. Reiss,et al.  Encoding program executions , 2001, Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001.

[4]  Vladlen Koltun Segment intersection searching problems in general settings , 2001, SCG '01.

[5]  Michael T. Goodrich,et al.  Dynamic trees and dynamic point location , 1991, STOC '91.

[6]  Robert E. Tarjan,et al.  Making Data Structures Persistent , 1989, J. Comput. Syst. Sci..

[7]  Pankaj K. Agarwal,et al.  Ray shooting and other applications of spanning trees with low stabbing number , 1992, SCG '89.

[8]  Yann-Gaël Guéhéneuc,et al.  No Java without caffeine: A tool for dynamic analysis of Java programs , 2002, Proceedings 17th IEEE International Conference on Automated Software Engineering,.

[9]  Paul F. Dietz Fully Persistent Arrays (Extended Array) , 1989, WADS.

[10]  Valerio Pascucci,et al.  Time-varying reeb graphs for continuous space-time data , 2004, SCG '04.

[11]  Kurt Mehlhorn,et al.  Maintaining dynamic sequences under equality tests in polylogarithmic time , 1994, SODA '94.

[12]  Cecilia R. Aragon,et al.  Randomized search trees , 1989, 30th Annual Symposium on Foundations of Computer Science.

[13]  Brandon Dixon,et al.  Implementing persistent data structures using C , 1998 .

[14]  Krishna R. Pattipati,et al.  Scheduling parallelizable tasks: putting it all on the shelf , 1992, SIGMETRICS '92/PERFORMANCE '92.

[15]  Erik D. Demaine,et al.  Retroactive data structures , 2007, TALG.

[16]  Marshall W. Bern,et al.  Hidden surface removal for rectangles , 1988, SCG '88.

[17]  Zhiqing Liu A persistent runtime system using persistent data structures , 1996, SAC '96.

[18]  Michiel H. M. Smid,et al.  Efficient algorithms for generalized intersection searching on non-iso-oriented objects , 1994, SCG '94.

[19]  Philip N. Klein,et al.  Multiple-source shortest paths in planar graphs , 2005, SODA '05.

[20]  Friedhelm Meyer auf der Heide,et al.  Dynamic perfect hashing: upper and lower bounds , 1988, [Proceedings 1988] 29th Annual Symposium on Foundations of Computer Science.

[21]  Franz Aurenhammer,et al.  A simple on-line randomized incremental algorithm for computing higher order Voronoi diagrams , 1992, Int. J. Comput. Geom. Appl..

[22]  Jack Snoeyink,et al.  Testing Homotopy for Paths in the Plane , 2004, Discret. Comput. Geom..

[23]  Guy E. Blelloch,et al.  Dynamizing static algorithms, with applications to dynamic trees and history independence , 2004, SODA '04.

[24]  Siu-Wing Cheng,et al.  Isomorphism testing and display of symmetries in dynamic trees , 1996, SODA '96.

[25]  Chris Okasaki,et al.  Purely functional data structures , 1998 .

[26]  David Eppstein Clustering for faster network simplex pivots , 1994, SODA '94.

[27]  Daniel M. Yellin Algorithms for subset testing and finding maximal sets , 1992, SODA '92.

[28]  Robert E. Tarjan,et al.  Planar Point Location Using Persistent Search Trees a , 1989 .

[29]  Dan E. Willard,et al.  Log-logarithmic worst-case range queries are possible in space ⊕(N) , 1983 .

[30]  Robert L. Grossman,et al.  Visibility with a moving point of view , 1994, SODA '90.

[31]  Richard J. Lipton,et al.  Multidimensional Searching Problems , 1976, SIAM J. Comput..

[32]  Prosenjit Bose,et al.  Translating a regular grid over a point set , 2003, Comput. Geom..

[33]  Micha Sharir,et al.  Hausdorff distance under translation for points and balls , 2003, TALG.