<<Up     Contents

Optimization of Java

This Optimization of Java is a collection of optimization techniques used in Java programming language.

Reduce a number of object creations

In Java, object creations are so expensive compared with other compiled object-oriented programming language. It is because in Java, object creation involves:

Eliminate simple methods such as accessor method

Because Java compiler cannot be completely sure about which method will be called before runtime, each method call involves looking up a method. Use of small and simple methods that are called frequently can be quite expensive. If possible, embed code of such method directly to the point of call.

Myths

There are some myths in performance tuning of Java programs.

wikipedia.org dumped 2003-03-17 with terodump