Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javac of jdk1.2 and jdk1.3  RSS feed

 
Akin Kaldiroglu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Do you have any idea about the differences, if any, between compilers (javac) of jdk1.2 and jdk1.3. I know and have experienced many times the difference between their VM's, i.e. 1.2's VM and HotSPot1.0 and 1.3's HotSpot2.0. How about static compilers, javac? Any new technique, optimization introduced with javac of jdk 1.3. I haven't heard anything about that so far. Have you?
I am asking this question because of following situation: We have a code in production. It is compiled with jdk 1.2.2. We want to compile it with 1.3 and run it in HotSpot. But we are using some third party components, which are compiled with jdk 1.2.2. And it seems that we won't have the opportunity to have them compiled with jdk 1.3. Can we say that if we can have those components compiled with jdk 1.3, we can gain some extra performance that comes from the new features of javac of jdk 1.3?
Thanks
Akin Kaldiroglu
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe most of the speed optimizations in DK 1.3 come from the VM and not from the compiler.* You should get good improvement running your code under Hotspot, regardless of how it was compiled. COnversely, running code compiled under the JDK 1.3 jaac will not be as fast as running it under JDK 1.2
*Note that the VM contains an internal compiler, which compiles into native code, and provides a good deal of speedup to the code, but this internal compiler is not the same as javac.
--Mark
hershey@vaultus.com
 
Akin Kaldiroglu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!