Reducing the Overhead of Dynamic Compilation

Chandra Krintz, David Grove, Vivek Sarkar, and Brad Calder

Software: Practice and Experience, pages 717-738, Volume 31, Issue 8, March 2001.

Abstract:

The execution model for mobile, dynamically-linked, object--oriented programs has evolved from fast interpretation to a mix of interpreted and dynamically compiled execution. The primary motivation for dynamic compilation is that compiled code executes significantly faster than interpreted code. However, dynamic compilation, which is performed while the application is running, introduces execution delay. In this paper we present two dynamic compilation techniques that enable high performance execution while reducing the effect of this compilation overhead. These techniques can be classified as: 1) decreasing the amount of compilation performed (Lazy Compilation), and 2) overlapping compilation with execution (Background Compilation).

We first evaluate the effectiveness of lazy compilation. In lazy compilation, individual methods are compiled on demand upon their first invocation. This is in contrast to Eager Compilation, in which all methods in a class are compiled when a new class is loaded. Our experimental results (obtained by executing the SpecJVM Java programs on the Jalapeno JVM) show that, compared to eager compilation, lazy compilation results in 57% fewer methods being compiled and reductions in total time (compilation plus execution time) of 14% to 26%.

Next, we present profile-driven, background compilation, a technique that augments lazy compilation by using idle cycles in multiprocessor systems to overlap compilation with application execution. Profile information is used to prioritize methods as candidates for background compilation. Our results show that background compilation can deliver significant reductions in total time (26% to 79%), compared to eager compilation.