I've noticed a significant slowdown in the JCK harness for Java
1.5 as compared to Java 1.4. This is when indexing tests. I've
traced it to the following location:
sun.text.Normalizer
This class contains a method called "next" in Java 1.5, which starts
by allocating arrays, one char[100] and one int[1]. Most of the calls
the JCK does to this method return before these arrays are used at
all, resulting in the garbage collection of many, many heaps full of
empty freshly allocated arrays. A great waste. Just moving these
allocations down to the call where they are sent as in parameters
reduces memory overhead significantly. This should maybe be treated
as a bug/problem in Java 1.5, since it's very uneconomic. The same
pattern appears in the "previous" method of the same class.
1.5 as compared to Java 1.4. This is when indexing tests. I've
traced it to the following location:
sun.text.Normalizer
This class contains a method called "next" in Java 1.5, which starts
by allocating arrays, one char[100] and one int[1]. Most of the calls
the JCK does to this method return before these arrays are used at
all, resulting in the garbage collection of many, many heaps full of
empty freshly allocated arrays. A great waste. Just moving these
allocations down to the call where they are sent as in parameters
reduces memory overhead significantly. This should maybe be treated
as a bug/problem in Java 1.5, since it's very uneconomic. The same
pattern appears in the "previous" method of the same class.