Adaptive just-in-time value class optimization for lowering memory consumption and improving execution time performance

Abstract The performance of value classes is highly dependent on how they are represented in the virtual machine. Value class instances are immutable, have no identity, and can only refer to other value objects or primitive values and since they should be very lightweight and fast, it is important to optimize them carefully. In this paper we present a technique to detect and compress common patterns of value class usage to improve memory usage and performance. The technique identifies patterns of frequent value object references and introduces abbreviated forms for them. This allows to store multiple inter-referenced value objects in an inlined memory representation, reducing the overhead stemming from meta-data and object references. Applied to a small prototype and an implementation of the Racket language, we found improvements in memory usage and execution time for several micro-benchmarks.

[1]  Jean-Christophe Filliâtre,et al.  Type-safe modular hash-consing , 2006, ML '06.

[2]  dizayn İç dekor Design by Contract , 2010 .

[3]  L. Peter Deutsch,et al.  Efficient implementation of the smalltalk-80 system , 1984, POPL.

[4]  Simon L. Peyton Jones,et al.  A short cut to deforestation , 1993, FPCA '93.

[5]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[6]  Michael Franz,et al.  HotpathVM: an effective JIT compiler for resource-constrained devices , 2006, VEE '06.

[7]  Xavier Leroy,et al.  The ZINC experiment : an economical implementation of the ML language , 1990 .

[8]  Cliff Click,et al.  The java hotspot TM server compiler , 2001 .

[9]  Andrew W. Appel,et al.  Unrolling lists , 1994, LFP '94.

[10]  Christopher A. Vick,et al.  The Java HotSpotTM Server Compiler , 2001 .

[11]  Carl Friedrich Bolz,et al.  Tracing the meta-level: PyPy's tracing JIT compiler , 2009, ICOOOLPS@ECOOP.

[12]  Daniel Gooch,et al.  Communications of the ACM , 2011, XRDS.

[13]  Saman Amarasinghe,et al.  Dynamic native optimization of interpreters , 2003, IVME '03.

[14]  Michael Leuschel,et al.  Allocation removal by partial evaluation in a tracing JIT , 2011, PEPM '11.

[15]  James G. Mitchell The Design and Construction of Flexible and Efficient Interactive Programming Systems , 1970, Outstanding Dissertations in the Computer Sciences.

[16]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[17]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[18]  Craig Chambers,et al.  An efficient implementation of SELF a dynamically-typed object-oriented language based on prototypes , 1989, OOPSLA 1989.

[19]  Andrei P. Ershov On programming of arithmetic operations , 1958, CACM.

[20]  Even Wiik Thomassen Trace-based just-in-time compiler for Haskell with RPython , 2013 .

[21]  Laurence Tratt,et al.  The impact of meta-tracing on VM design and implementation , 2015, Sci. Comput. Program..

[22]  Samuele Pedroni,et al.  PyPy's approach to virtual machine construction , 2006, OOPSLA '06.

[23]  James C. McKim,et al.  Design by Contract, By Example , 2001, TOOLS.

[24]  Martin Odersky,et al.  An Overview of the Scala Programming Language , 2004 .

[25]  Robert Hirschfeld,et al.  Optimizing record data structures in Racket , 2016, SAC.

[26]  Akihiko Takano,et al.  Shortcut deforestation in calculational form , 1995, FPCA '95.

[27]  Cliff Click,et al.  The Java HotSpot Server Compiler , 2001, Java Virtual Machine Research and Technology Symposium.

[28]  William M. Shyu,et al.  Local Regression Models , 2017 .

[29]  Oscar Nierstrasz,et al.  Back to the Future in One Week - Implementing a Smalltalk VM in PyPy , 2008, S3.

[30]  Sam Tobin-Hochstadt,et al.  Pycket: a tracing JIT for a functional language , 2015, ICFP.

[31]  Marc Feeley,et al.  Extending Basic Block Versioning with Typed Object Shapes , 2015, ArXiv.

[32]  Mason Chang,et al.  Trace-based just-in-time type specialization for dynamic languages , 2009, PLDI '09.

[33]  Craig Chambers,et al.  An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes , 1989, OOPSLA '89.

[34]  Carl Friedrich Bolz,et al.  Meta-Tracing Just-in-Time Compilation for RPython , 2014 .

[35]  Nikolai Tillmann,et al.  SPUR: a trace-based JIT compiler for CIL , 2010, OOPSLA.

[36]  Michael Leuschel,et al.  Runtime feedback in a meta-tracing JIT for efficient dynamic languages , 2011, ICOOOLPS@ECOOP.

[37]  David F. Bacon,et al.  Kava: a Java dialect with a uniform object model for lightweight classes , 2001, JGI '01.

[38]  Peri L. Tarr,et al.  Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications , 2006, OOPSLA 2006.

[39]  Peter Beike,et al.  The Definition Of Standard Ml Revised , 2016 .

[40]  John Aycock,et al.  A brief history of just-in-time , 2003, CSUR.

[41]  Peter Lee,et al.  Optimizing ML with run-time code generation , 1996, SIGP.

[42]  Matthias Felleisen,et al.  Control operators, the SECD-machine, and the λ-calculus , 1987, Formal Description of Programming Concepts.

[43]  Robin Milner,et al.  Definition of standard ML , 1990 .