aspose file tools*
The moose likes Java in General and the fly likes Performance of JVM of J2SE1.4, Java5, Java6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Performance of JVM of J2SE1.4, Java5, Java6" Watch "Performance of JVM of J2SE1.4, Java5, Java6" New topic
Author

Performance of JVM of J2SE1.4, Java5, Java6

Tejas Jain
Ranch Hand

Joined: Mar 04, 2008
Posts: 119
Which one gives the best performance for the same java code (I mean not using the new features in Java 5&6)?


"Knowing is not enough, you must apply... Willing is not enough, you must do."
--Bruce Lee
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Now that is a tricky question.


===Vyas Sanzgiri===
My Blog
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

I have no facts to prove my statement, but I'd say the JVM becomes better and faster after each version, so if I had to guess it would be Java6.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14352
    
  22

Here is a link: Java SE 6 - Improvements to Program Execution Speed

In general, newer versions of Sun's Java implementation are faster than older ones, sometimes a lot faster.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42641
    
  65
Especially multi-thread performance has improved tremendously between Java 1.4 and Java 6 (meaning lock contention, synchronization etc. have much less of an impact than they used to).


Ping & DNS - my free Android networking tools app
Daniel Chemko
Ranch Hand

Joined: Feb 27, 2008
Posts: 32
In my own codebase, I did some profiling and found that dealing with the reflections API, I've found timing as:
Java 1.4.2 - 10
Java 1.5.0 - 5
Java 1.6.0 - 4

So yes, the newer JVM's perform much better than previous releases doing the same thing. The GUI will get some interesting optimizations from 1.6 onward since they're no longer doing Swing/AWT work on a single thread. This can possibly run into races if you're doing GUI work on other threads, so watch out for that. Also, 1.6+ has greatly improved the performance of graphics in pretty much every conceivable way. The same code should run significantly faster.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

Daniel Chemko wrote:The GUI will get some interesting optimizations from 1.6 onward since they're no longer doing Swing/AWT work on a single thread.

Really? Can you please Quote Your Sources? Because as far as I know, there is still only one Event Dispatcher Thread.
It is made easier to handle threading in Swing with SwingWorker, but all GUI related code still must be executed on the EDT.
Daniel Chemko
Ranch Hand

Joined: Feb 27, 2008
Posts: 32
"Really? Can you please Quote Your Sources? Because as far as I know, there is still only one Event Dispatcher Thread.
It is made easier to handle threading in Swing with SwingWorker, but all GUI related code still must be executed on the EDT."

Caught my ambiguity. I ran into several errors when dealing with my code, and when running through a debugger, EDT based errors were automatically suspended on the last stack entry "EventDispatchThread.run() line: 156".

If several errors are queued up, the debugger will list all the EDT's that generated the error. The problem was that the EDT was being regenerated after each error giving the false impression that they were running independently. Thanks for the catch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Performance of JVM of J2SE1.4, Java5, Java6