[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2500828.2500839acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Efficient interpreter optimizations for the JVM

Published: 11 September 2013 Publication History

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.

References

[1]
J. R. Bell. Threaded code. Communications of the ACM, 16 (6):370--372, 1973.
[2]
M. Berndl, B. Vitale, M. Zaleski, and A. D. Brown. Context threading: A flexible and efficient dispatch technique for virtual machine interpreters. In Proceedings of the International Symposium on Code Generation and Optimization, CGO '05, pages 15--26, Washington, DC, USA, 2005. IEEE Computer Society.
[3]
C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 4th Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS '09), Lecture Notes in Computer Science, pages 18--25. Springer, 2009. ISBN 978-3-642-03012-3.
[4]
E. Bruneton, R. Lenglet, and T. Coupaye. Asm: A code manipulation tool to implement adaptable systems. In In Adaptable and extensible component systems, 2002.
[5]
S. Brunthaler. Virtual-machine abstraction and optimization techniques. In Proceedings of the 4th International Workshop on Bytecode Semantics, Verification, Analysis and Transformation, York, United Kingdom, March 2009 (BYTECODE '09), volume 253(5) of Electronic Notes in Theoretical Computer Science, pages 3--14, Amsterdam, The Netherlands, December 2009. Elsevier.
[6]
S. Brunthaler. Purely Interpretative Optimizations. PhD thesis, Vienna University of Technology, February 2011.
[7]
M. Chang, E. Smith, R. Reitmaier, M. Bebenita, A. Gal, C. Wimmer, B. Eich, and M. Franz. Tracing for web 3.0: Trace compilation for the next generation web applications. In Proceedings of the ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, Washington, DC, USA (VEE '09), pages 71--80, New York, NY, USA, 2009. ACM, ACM.
[8]
C. Curley. Optimizing FastForth: Optimizing in a BSR/JSR Threaded Forth. Forth Dimensons, 1993.
[9]
C. Curley. Life in the FastForth Lane. Forth Dimensons, 1993.
[10]
David A. Wheeler. Sloccount. http://www.dwheeler.com/sloccount/.
[11]
E. H. Debaere and J. M. van Campenhout. Interpretation and Instruction Path Coprocessing. Computer systems. MIT Press, 1990. ISBN 978-0-262-04107-2.
[12]
M. A. Ertl and D. Gregg. The structure and performance of efficient interpreters. Journal of Instruction-Level Parallelism, 5:1--25, November 2003.
[13]
M. A. Ertl and D. Gregg. Optimizing indirect branch prediction accuracy in virtual machine interpreters. In Proceedings of the SIGPLAN '03 Conference on Programming Language Design and Implementation (PLDI '03), pages 278--288, New York, NY, USA, 2003. ACM.
[14]
M. A. Ertl and D. Gregg. Combining stack caching with dynamic superinstructions. In IVME '04 {18}, pages 7--14. ISBN 1-58113-909-8.
[15]
B. Fulgham. The computer language benchmarks game. http://shootout.alioth.debian.org/.
[16]
Intel. Intel turbo boost technology -- on-demand processor performance, 2012. URL http://www.intel.com/content/www/us/en/architecture-and-technology/turbo-boost/turbo-boost-technology.html.
[17]
K. Ishizaki, T. Ogasawara, J. Castanos, P. Nagpurkar, D. Edelsohn, and T. Nakatani. Adding dynamically-typed language support to a statically-typed language compiler: performance evaluation, analysis, and tradeoffs. In Proceedings of the 8th ACM SIGPLAN/SIGOPS conference on Virtual Execution Environments, VEE '12, pages 169--180, New York, NY, USA, 2012. ACM. URL http://doi.acm.org/10.1145/2151024.2151047.
[18]
IVME '04. Proceedings of the 2004 Workshop on Interpreters, virtual machines and emulators (IVME '04), New York, NY, USA, 2004. ACM. ISBN 1-58113-909-8.
[19]
P. M. Kogge. Am architectural trail to threaded-code systems. IEEE Computer, 15(3):22--32, 1982.
[20]
T. Kotzmann, C. Wimmer, H. Mössenböck, T. Rodriguez, K. Russell, and D. Cox. Design of the Java HotSpot#8482; client compiler for Java 6. ACM Transactions on Architecture and Code Optimization (TACO), 5(1):1--32, 2008.
[21]
X. Leroy. Java bytecode verification: Algorithms and formalizations. Journal of Automated Reasoning, 30(3-4):235--269, 2003.
[22]
Linux. Perf. https://perf.wiki.kernel.org/index.php/Main_Page.
[23]
Oracle Corporation. Da Vinci Machine Project. http://openjdk.java.net/projects/mlvm/.
[24]
M. Paleczny, C. Vick, and C. Click. The Java HotSpot#8482; server compiler. In Proceedings of the 2001 Symposium on Java Virtual Machine Research and Technology - Volume 1, JVM'01, pages 1--12, Berkeley, CA, USA, 2001. USENIX Association.
[25]
T. A. Proebsting. Optimizing an ANSI C interpreter with superoperators. pages 322--332, 1995.
[26]
Y. Shi, K. Casey, M. A. Ertl, and D. Gregg. Virtual machine showdown: Stack versus registers. ACM Transactions on Architecture and Code Optimization, 4(4):1--36, 2008.
[27]
Sun Microsystems Inc. JSR 292: Supporting Dynamically Typed Languages on the Java Platform. Early Draft, July 2011.
[28]
B. Vitale and T. S. Abdelrahman. Catenation and specialization for Tcl virtual machine performance. In IVME '04 {18}, pages 42--50. ISBN 1-58113-909-8.
[29]
C. Wimmer, M. Haupt, M. L. V. de Vanter, M. J. Jordan, L. Daynès, and D. Simon. Maxine: An approachable virtual machine for, and in, Java. ACM Transactions on Architecture and Code Optimization (TACO), 9(4), 2013.
[30]
A. Yermolovich, C. Wimmer, and M. Franz. Optimization of dynamic languages using hierarchical layering of virtual machines. In Proceedings of the 5th Symposium on Dynamic Languages, Orlando, Florida, US, October 26th, 2009 (DLS '09), pages 79--88, New York, NY, USA, 2009. ACM, ACM.

Cited By

View all
  • (2019)Interpretizer: A Compiler-Independent Conversion of Switch-Based Dispatch into Threaded CodeSoftware Technology: Methods and Tools10.1007/978-3-030-29852-4_4(59-72)Online publication date: 8-Oct-2019
  • (2015)Branch prediction and the performance of interpreters — Don't trust folklore2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO.2015.7054191(103-114)Online publication date: Feb-2015

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PPPJ '13: Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools
September 2013
188 pages
ISBN:9781450321112
DOI:10.1145/2500828
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 September 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java virtual machine
  2. Jython
  3. Rhino
  4. dynamic languages
  5. interpreters
  6. just-in-time compilers
  7. threaded code

Qualifiers

  • Research-article

Funding Sources

Conference

PPPJ '13
PPPJ '13: virtual machines, languages, and tools
September 11 - 13, 2013
Stuttgart, Germany

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Interpretizer: A Compiler-Independent Conversion of Switch-Based Dispatch into Threaded CodeSoftware Technology: Methods and Tools10.1007/978-3-030-29852-4_4(59-72)Online publication date: 8-Oct-2019
  • (2015)Branch prediction and the performance of interpreters — Don't trust folklore2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO.2015.7054191(103-114)Online publication date: Feb-2015

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media