arrow
Return

Techniques for obtaining high performance in Java programs

delete2000-09-01
delete57
delete
OA
AI
I
Iffat H. Kazi
H
Howard H. Chen
B
Berdenia Stanley
D
David J. Lilja
DOI:10.1145/367701.367714delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
This survey describes research directions in techniques to improve the performance of programs written in the Java programming language. The standard technique for Java execution is interpretation, which provides for extensive portability of programs. A Java interpreter dynamically executes Java bytecodes, which comprise the instruction set of the Java Virtual Machine (JVM). Execution time performance of Java programs can be improved through compilation, possibly at the expense of portability. Various types of Java compilers have been proposed, including Just-In-Time (JIT) compilers that compile bytecodes into native processor instructions on the fly; direct compilers that directly translate the Java source code into the target processor's native language; and bytecode-to-source translators that generate either native code or an intermediate language, such as C, from the bytecodes. Additional techniques, including bytecode optimization, dynamic compilation, and executing Java programs in parallel, attempt to improve Java run-time performance while maintaining Java's portability. Another alternative for executing Java programs is a Java processor that implements the JVM directly in hardware. In this survey, we discuss the basic features, and the advantages and disadvantages, of the various Java execution techniques. We also discuss the various Java benchmarks that are being used by the Java community for performance evaluation of the different techniques. Finally, we conclude with a comparison of the performance of the alternative Java execution techniques based on reported results.
Keywords:
languages
performance
Java
Java virtual machine
interpreters
just-in-time compilers
direct compilers
bytecode-to-source translators
dynamic compilation

AI Summary

Brief Overview

In September 2000, Iffat H. Kazi, Howard H. Chen, Berdenia Stanley, and David J. Lilja published the paper "Techniques for obtaining high performance in Java programs" online in ACM COMPUTING SURVEYS. This study systematically reviews multiple technical pathways for improving the execution speed of Java programs, addressing the critical challenge of balancing cross-platform portability with execution efficiency. By comparatively analyzing approaches such as interpretation, just-in-time compilation, direct compilation, bytecode translation, and hardware-level Java processors, the paper reveals the trade-offs among speed, compatibility, and implementation complexity for various methods, providing a clear framework for developers and system designers to select appropriate technical routes for specific scenarios.

Research Abstract

In the late 1990s, Java quickly gained widespread adoption due to its "write once, run anywhere" capability. However, its reliance on the virtual machine for interpretive execution caused program running speeds to be 10–50 times slower than traditional languages such as C, severely limiting its application in high-performance scenarios like scientific computing and real-time systems. At that time, mainstream solutions such as pure interpreters, while fully compatible, operated with extremely low efficiency, similar to interpreting a meeting sentence by sentence with a translator; just-in-time compilation (JIT), although capable of translating code during execution to improve speed, was constrained by compilation time and could only perform simple optimizations; direct compilation to machine code, while fast like a native language speech, sacrificed cross-platform capability. This paper performs the first unified evaluation of more than a dozen acceleration techniques, including bytecode optimization, parallel execution, and intelligent garbage collection. Combining benchmark data from SPEC JVM98, it indicates that "dynamic adaptation + hierarchical optimization" is a feasible direction for balancing speed and compatibility, laying the theoretical foundation for subsequent industrial-level solutions such as the HotSpot virtual machine.

Background

The core advantage of Java lies in its ability to "write once and run on all devices," which is achieved by first converting code into a common intermediate instruction set (bytecode) and then having the virtual machine on each platform responsible for execution. This is akin to a universally understood musical score that any instrument can perform. However, this high level of abstraction comes at a significant cost: each execution requires on-the-spot translation (interpretation) or temporary compilation (JIT), taking much more time than directly executing C language programs. Strategy A (pure interpretation), although perfectly compatible, is as slow as a snail; Strategy B (direct compilation), although as fast as a racing car, can only run on specific vehicle types. Therefore, how to enable Java to maintain the universality of the "musical score" while achieving speeds approaching those of "native performance" became a fundamental contradiction in the software engineering field at the time, urgently needing to be overcome.

Key Highlights

  1. Instant translation without waiting: The JIT compiler acts like simultaneous interpretation in a meeting, translating only high-frequency code segments (such as loop bodies) into machine language in real-time during program execution. This avoids the time consumption of full compilation and speeds up critical paths by 5–20 times, which is equivalent to carrying a whole dictionary with you but only looking up the 10 most frequently referenced pages.
  2. Bytecode slimming: Through means such as compressing class names, removing useless code, and intelligently rearranging array fields, the size of Java programs can be reduced by up to 90%, significantly improving loading speed. This is comparable to deleting rare characters and illustrations from a thick dictionary, leaving only core entries.
  3. Hardware-level virtual machines: Specialized Java processors (such as picoJava) directly implement virtual machine instructions as chip circuits, eliminating the software translation process. This improves performance by 12 times compared to ordinary interpreters, which is equivalent to customizing a dedicated piano for Java, eliminating the need to simulate performance with other instruments.

Summary and Outlook

Based on multi-path collaborative optimization strategies, the progressive mechanism of dynamically identifying hot code, tiered compilation, and hardware acceleration has achieved stepwise breakthroughs in Java execution efficiency. This technology possesses the dual advantages of cross-platform compatibility and near-native performance. The results show that under standard server loads, a speedup of 5–20 times was obtained, and in web application startup scenarios, startup time was shortened by 25%. This study not only addresses the industry pain point of delayed response in enterprise-level Java services but also, by constructing a quantitative evaluation framework for "performance-compatibility," provides a methodological foundation for JVM design, cloud-native middleware, and the development of virtual machines for domestic programming languages.

errShare
errSave
Efficient register mapping and allocation in LaTTe, an open-source Java just-in-time compiler
err2007-01-01
err6
errOAAI
errYang, Byung-Sun; Lee, Junpyo; Lee, Seungll; Park, Seongbae; Chung, Yoo C.; Kim, Suhyun; Ebcioglu, Kemal; Altman, Erik; Moon, Soo-Mook
errShare
errSave
errShare
errSave

Journal

ACM Computing Surveys cover
ACM Computing Surveys
IF:
28
Papers:
2.7K
Citations:
4.6W

Organization

No organization information available
Cited Papers

Cited Papers

Increased prevalence of the Taq I A1allele of the dopamine receptor gene (DRD2) in obesity with comorbid substance use disorder: a preliminary report
err1996-08-01
err0
PREAI
errKenneth Blum; Eric R. Braverman; Robert C. Wood; James Gill; Christie Li; Thomas J.H. Chen; Mathew Taub; Ann R. Montgomery; Peter J. Sheridan; John G. Cull
errShare
errSave
Long-term complications of platinum-based chemotherapy in testicular cancer survivors
err2007-06-01
err0
PREAI
errJ. H. Oh; D. D. Baum; S. Pham; M. Cox; S. T. Nguyen; J. Ensor; I. Chen
errShare
errSave
Adaptor-Dependent Degradation of a Cell-Cycle Regulator Uses a Unique Substrate Architecture
err2012-07-01
err0
errOAAI
errKeith L. Rood; Nathaniel E. Clark; Patrick R. Stoddard; Scott C. Garman; Peter Chien
errShare
errSave
Evidence for a persistent, major excess in all cause admissions to hospital in children with type-1 diabetes: results from a large Welsh national matched community cohort study
err2015-04-13
err0
errOAAI
errAdrian Sayers; Daniel Thayer; John N Harvey; Stephen Luzio; Mark D Atkinson; Robert French; Justin T Warner; Colin M Dayan; Susan F Wong; John W Gregory
errShare
errSave
Type 1 diabetes mellitus and educational attainment in childhood: a systematic review
err2020-01-26
err0
errOAAI
errNatalie Jayne Oakley; Dylan Kneale; Mala Mann; Mariann Hilliar; Colin Dayan; John W Gregory; Robert French
errShare
errSave
researcher View more