Efficient interpreter optimizations for the JVM

  • Authors:
  • Gülfem Savrun-Yeniçeri;Wei Zhang;Huahan Zhang;Chen Li;Stefan Brunthaler;Per Larsen;Michael Franz

  • Affiliations:
  • University of California, Irvine, CA;University of California, Irvine, CA;University of California, Irvine, CA;University of California, Irvine, CA;University of California, Irvine, CA;University of California, Irvine, CA;University of California, Irvine, CA

  • Venue:
  • Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Java virtual machine is a popular target for many language implementers. Due to the unusually poor performance of hosted interpreters, many programming language implementers resort to implementing a custom compiler that emits Java bytecode instead. We studied performance of these hosted interpreters targeting the JVM and identified common bottlenecks preventing their efficient execution. First, similar to interpreters written in C/C++, instruction dispatch is expensive on the JVM. Second, Java's array semantics dictate expensive runtime exception checks, which negatively affect array performance essential to interpreters. We present two optimizations targeting these bottlenecks and show that the performance of the optimized interpreters increases dramatically: we report speedups by a factor of up to 2.45 over the Jython interpreter, and 3.57 over the Rhino interpreter respectively. Furthermore, the performance attained through our optimizations is comparable with custom compiler performance. We provide an easily accessible annotation-based interface to enable our optimizations. Thus, interpreter implementers can expect substantial performance boosts in a matter of hours of implementation effort.