Techniques for obtaining high performance in Java programs
Abstract
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
- 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.
- 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.
- 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.

