As Java technology matures, an increasing number of applications that have traditionally been the domain of languages such as C++ are implemented in Java. Many of these applications such as Internet servers demand high execution speed. Currently, it is mostly the programmer’s responsibility to optimize Java code for speed. This paper presents several simple yet effective source code-level guidelines for accelerating Java programs. Among the performance enhancing rules described in the paper are object reuse, avoiding Java API methods with implicit object allocations, statically creating immutable objects, thread pooling, and avoiding dynamically expanding objects. All these rules aim at reducing the frequency of object allocations and objectto-object copy operations. Using examples, the paper demonstrates up to 15-fold accelerations by using these guidelines. When applied under the appropriate circumstances explained in the paper, none of the rules leads to performance penalties.
[1]
Ken Arnold,et al.
The Java Programming Language
,
1996
.
[2]
Dennis de Champeaux,et al.
Object-oriented system development
,
1993
.
[3]
Bruce Eckel.
Thinking in Java
,
1998
.
[4]
Ken Arnold,et al.
The Java programming language (2nd ed.)
,
1998
.
[5]
Prashant Jain,et al.
The Design and Performance of MedJava
,
1998,
COOTS.
[6]
Prashant Jain,et al.
The design and performance of MedJava: a distributed electronic medical imaging system developed with java applets and web tools
,
1998
.
[7]
Reinhard Klemm.
WebCompanion: A Friendly Client-Side Web Prefetching Agent
,
1999,
IEEE Trans. Knowl. Data Eng..