I believe what you are saying is true. Most of the performance
benefits come from HotSpot VM not from static compiler (javac) of JDK1.3. And my experience says to me that javac of JDK1.3 is not much different from javac of JDK1.2. Here are a buch of benchmarks regarding this isuue. I have run James Gosling's QuickSort algorithm (
http://java.sun.com/applets/jdk/1.1/demo/SortDemo/QSortAlgorithm.java) with different compilers and JVMs. My system is WindowsNT 4.0 with SP5, has 256 MB of RAM and 730 MHz. Pentium III.
I created an array with 10000000 integers. Ther are totally reversed, i.e. array[0] = 1 and array[9999999] = 10000000
jdk1.2.2 jdk1.3 jdk1.3 -classic jdk1.3 -server
-------- ------ --------------- --------------
3896 5308 43552 6119
3955 5328 43723 6128
3955 5308 43593 6148
3955 5328 43623 6159
4005 5348 43612 6089
---- ---- ----- ----
3971.2 5324 43620.6 6128.6
Compiled with jdk1.2.2 but run under jdk1.3
--------------------------------------------
5387
5277
5368
5238
5258
----
5305.6
Compiled with jdk1.2.2 but run under jdk1.3 -classic
---------------------------------------------------
43443
43532
43713
43603
43383
-----
43534.8
Compiled with jdk1.2.2 but run under jdk1.3 -server
---------------------------------------------------
6159
6219
6099
6079
6099
----
6131
Although the algorithm I choose is too specific to reflect comparisions correctly, it would give us an idea about what we have been talking about.
Some of the things that we can withdraw from the results:
1- VM of jdk1.2.2 seems the fastest one. Notice that it has JIT.
2- Client HotSPot (jdk1.3) is faster than Server HotSpot (jdk1.3 -server) for this case. This is expected because Client HotSpot makes fast and easy optimizations whereas Server HotSpot takes more time to show its effect on the performance.
3- jdk1.3 -classic has an awful performance since its JIT is turned off.
4- It doesn't make any difference, at least for this case, whether you compile your code with jdk1.2.2 javac or jdk1.3 javac if you run it in jdk 1.3 JVM, whether it be Client HotSpot or it be Server HotSpot.
5- You are dead if you don't use any run time environment that somehow compiles some of your bytecode into the native code!
Thanks.
Akin Kaldiroglu