Compilation queuing and graph caching for dynamic compilers

Modern virtual machines for Java use a dynamic compiler to optimize the program at run time. The compilation time therefore impacts the performance of the application in two ways: First, the compilation and the program's execution compete for CPU resources. Second, the sooner the compilation of a method finishes, the sooner the method will execute faster. In this paper, we present two strategies for mitigating the performance impact of a dynamic compiler. We introduce and evaluate a way to cache, reuse and, at the right time, evict the compiler's intermediate graph representation. This allows reuse of this graph when a method is inlined multiple times into other methods. We show that the combination of late inlining and graph caching is highly effective by evaluating the cache hit rate for several benchmarks. Additionally, we present a new mechanism for optimizing the order in which methods get compiled. We use a priority queue in order to make sure that the compiler processes the hottest methods of the program first. The machine code for hot methods is available earlier, which has a significant impact on the first benchmark. Our results show that our techniques can significantly improve the start up performance of Java applications. The techniques are applicable to dynamic compilers for managed languages.

[1]  Urs Hölzle,et al.  Reconciling responsiveness with performance in pure object-oriented languages , 1996, TOPL.

[2]  Ron Cytron,et al.  Does “just in time” = “better late than never”? , 1997, POPL '97.

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

[4]  Chandra Krintz,et al.  Online phase detection algorithms , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[5]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[6]  David Gay,et al.  Memory management with explicit regions , 1998, PLDI.

[7]  Rainer Plaga The GRAAL project , 1999 .

[8]  Prasad A. Kulkarni,et al.  JIT compilation policy for modern machines , 2011, OOPSLA '11.

[9]  Escape Analysis for Java. Theory and Practice , 2003 .

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

[11]  Giovanni Agosta,et al.  Dynamic Look Ahead Compilation: A Technique to Hide JIT Compilation Latencies in Multicore Environment , 2009, CC.

[12]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[13]  Igor Böhm,et al.  Generalized just-in-time trace compilation using a parallel task farm in a dynamic binary translator , 2011, PLDI '11.

[14]  Vivek Sarkar,et al.  Reducing the overhead of dynamic compilation , 2001, Softw. Pract. Exp..

[15]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.