MicroJIT: a lightweight just-in-time compiler to improve startup times
University of New Brunswick
The startup phase of an application represents a tiny fraction of the total runtime, but it is considered, nevertheless, a critical phase for both client and server environments. In the JVM, the Just-in-Time compiler (JIT) translates Java bytecodes to native machine code to improve the performances of an application. This thesis investigates whether using two different JIT compilers in the same JVM can improve startup time. A lightweight JIT system (i.e. MicroJIT) has been integrated into the J9 JVM and it has been set up to perform an initial, low-optimized, but fast compilation while, at a latter time, the standard JIT recompiles Java bytecodes with better, but more expensive, optimizations. This solution has been evaluated using different benchmarks and metrics and has been compared to the JVM in different configurations: default configuration, standard JIT tuned for optimal startup time (option Xquickstart) and executing the Java application with Ahead-of-Time code available from the Shared Class Cache. Experimental results show that enabling MicroJIT, compared to the default configuration, significantly reduces the startup time of the considered benchmarks but with a cost in memory usage and, in some cases, a reduction in throughput performance. The solution presented in this thesis does not improve the startup time as much as the other solution already implemented in the JVM, however in some conditions it could be the best option since, the penalty on throughput performance is less than the one caused by using the option Xquickstart to tune the main JIT system for optimal startup time, and it does not require the presence of the Shared Class Cache.