Skip to main content

Question regarding 1.6 performance

11 replies [Last post]
markuss
Offline
Joined: 2006-03-10
Points: 0

Hi fellow developers,

a friend of mine told me, that 1.6 has better performance that 1.5. But he also told me that you only get the full performance benefit if you re-compile your application with JDK 1.6. Do you know where I can find more information about this topic? The 1.6 performance white paper is not ready yet.

Thanks in advance
Markus

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07
Points: 0

Won't using the Java ME preverifier work just as well?
The concept integrated into Java 6 has existed in CLDC since its inception (mostly due to VM size constraints). The preverifier tool is available as part of the Java ME RI (the Wireless Toolkit) and is a single executable (available for Linux too) that can convert classes to "preverified" classes.

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

Well recompiling with "-target 1.6" will only improve class-load-time, not runtime performance.

> Won't using the Java ME preverifier work just as
> well?
No.

lg Clemens

carmello
Offline
Joined: 2003-09-10
Points: 0

Improvedd class-load-time is also nice, especialy during startup of an Java application, especialy with big application like Eclipse, NetBeans, etc.

neverever
Offline
Joined: 2006-05-22
Points: 0

Except for the split verifier which only improves class load time slightly, none of the other major performance improvements in 1.6 require recompilation. So I wouldn't worry that you're losing out on much.

tom

lafortune
Offline
Joined: 2004-11-23
Points: 0

The Java ME preverifier adds StackMap attributes to the class files that it preverifies. The JDK 1.6 compiler adds StackMapTable attributes to the class files that it compiles. The latter contain essentially the same information, but their format is more compact. The VM only considers them if the version number of the class files is 1.6 or higher.

The preverification step has been integrated in the compiler, because it can then easily use typing information from the source code -- information that is lost in the compiled class files. A separate preverifier may have to do some complex analyses to recover all information. Even the Java ME preverifier is not perfect in this respect.

I have seen some references to the ASM library containing a preverifier, but I don't know how well it works.

The upcoming version 4.0 of ProGuard contains a preverifier too (ProGuard is a free java shrinker, optimizer, and obfuscator, http://proguard.sourceforge.net/). It allows to retarget class files and preverify them, for JME and for 1.6. At this time, I am still working on the documentation and examples, and testing the new features. I'll release version 4.0 when this is done.

Eric -- author of ProGuard

andrei
Offline
Joined: 2003-12-30
Points: 0
markuss
Offline
Joined: 2006-03-10
Points: 0

Thank you, forax! This helps me a lot. I will give it a try with out application to see if it really makes a difference.

forax
Offline
Joined: 2004-10-07
Points: 0

The bytecode verifier has changed in 1.6
to use a linear scan algorithm.
But this algorithme requires the java compiler to insert a special attribute at some places in the bytecode.

see
https://jdk.dev.java.net/verifier.html

and
http://jcp.org/en/jsr/detail?id=202

so re-compile with -target 6 will produce
a bytecode "split-verifiable". In that case
the verification done when a class is loaded
by a 1.6 VM is always faster than with the old
verifier.

Rémi

cowwoc
Offline
Joined: 2003-08-24
Points: 0

Wouldn't it be nice if we could "upgrade" individual class files or entire JAR files from pre-Java6 to Java6 class format without access to the source code? This should be technically possible right?

Gili

tompalmer
Offline
Joined: 2006-08-26
Points: 0

cowwoc, off the top of my head, I'd guess you are right, but I'm no expert in the matter. And I also agree that a "java6ify this jar" tool could be nice in some cases.

forax
Offline
Joined: 2004-10-07
Points: 0

I think with ASM 3, it shouln't be so difficult to
do that.

http://asm.objectweb.org/

Rémi