-
Enhancement
-
Resolution: Fixed
-
P4
-
1.3.1, 1.4.1
-
beta2
-
x86, sparc
-
solaris_2.5, solaris_8
Hotspot Server JVM performance when handling ArrayIndexOutOfBoundsException
In our testing, we have found that the Hotspot Server JVM performance in
handling ArrayIndexOutOfBoundsException is far poorer than the Hotspot
Client JVM.
Running the attached CPUThread1 test, with parameter 100000, 2 (this will
cause 100000 ArrayIndexOOB exceptions in a row and log the time):
Client VM: 3078 ms
Server VM: 11735 ms
This is approx. a 280% increase over the client VM. In applications which
throw this exception frequently (one of our third party libraries has this
behavior), performance is vastly inferior on the Server VM.
Details:
1.Machine Details:
Windows NT 4.0
Dual Pentium 3 Xeon processors (600 MHz)
2 GB RAM
JDK 1.3.1_02 installed.
2.Test Details:
After compiling the program, run it by calling: java CPUThread1 100000 2
The parameters are as follows: parameter 1 is the number of iterations to
perform. For the tests above, this was 100000. Note that this number
must be fairly high in order for the time of the operation to be
measurable. Parameter 2 is the index into the array to use. If this is
2, then an ArrayIndexOutOfBoundsExcception will be thrown.
Attached Files:
CPUThread1.java - the testing/reproduction program for this issue.
------------------------------
Fixed by reworking the "built-in" exception processing.
Now all cold exceptions (first few times) are handled by
uncommon traps. After recompilation, the compiler may
choose a faster tactic using preallocated exceptions,
under control of the switch -XX:+OmitStackTraceInFastThrow
(default true).
The fix applies the same technique uniformly to all Java
bytecode traps, including NPE, RCE, DIV0, and casts.
###@###.### 2004-03-04
In our testing, we have found that the Hotspot Server JVM performance in
handling ArrayIndexOutOfBoundsException is far poorer than the Hotspot
Client JVM.
Running the attached CPUThread1 test, with parameter 100000, 2 (this will
cause 100000 ArrayIndexOOB exceptions in a row and log the time):
Client VM: 3078 ms
Server VM: 11735 ms
This is approx. a 280% increase over the client VM. In applications which
throw this exception frequently (one of our third party libraries has this
behavior), performance is vastly inferior on the Server VM.
Details:
1.Machine Details:
Windows NT 4.0
Dual Pentium 3 Xeon processors (600 MHz)
2 GB RAM
JDK 1.3.1_02 installed.
2.Test Details:
After compiling the program, run it by calling: java CPUThread1 100000 2
The parameters are as follows: parameter 1 is the number of iterations to
perform. For the tests above, this was 100000. Note that this number
must be fairly high in order for the time of the operation to be
measurable. Parameter 2 is the index into the array to use. If this is
2, then an ArrayIndexOutOfBoundsExcception will be thrown.
Attached Files:
CPUThread1.java - the testing/reproduction program for this issue.
------------------------------
Fixed by reworking the "built-in" exception processing.
Now all cold exceptions (first few times) are handled by
uncommon traps. After recompilation, the compiler may
choose a faster tactic using preallocated exceptions,
under control of the switch -XX:+OmitStackTraceInFastThrow
(default true).
The fix applies the same technique uniformly to all Java
bytecode traps, including NPE, RCE, DIV0, and casts.
###@###.### 2004-03-04
- duplicates
-
JDK-4671762 Excessive/looping deoptimization with ECperf
-
- Closed
-