Search code examples
performancemigrationjava-6java1.4

Java 1.4 to Java 6 migration


I have some enterprise apps running on Java 1.4. They mostly invoke Stored Procedures on a DB, Parse XML files (at the most few megs large), read and write from and to disk. We have a requirement where now we have to migrate these apps to Java 6(No code changes to be done at all).

My questions:

  • If I don't recompile my apps under Java 6 and just run them with it, will it work fine (I know they 'should')? But if somebody thinks other way round, could you kindly share your thoughts please?
  • More important question is - Will it have any performance impact?. As in, App compiled on 1.4 and running on 1.6 vs App compiled and running on 1.6. Is 1.6 going to do any bytecode optimization for the same old piece of code compared to 1.4?

Many Thanks js


Solution

  • It's not the byte code that gets optimized, the byte code format hasn't changed since Java 1(!). The JVM will optimize those parts of the code where runtime analysis tells it that it is worthwhile, but in the JIT-compiled native code. And yes, the step from 4 to 6 should result in better performance - virtual machines have come a long way in those 4.5 years.