PDA

View Full Version : Alternative to Apple Java VM?




Desperado
Jul 19, 2006, 04:10 AM
Hello there

I've been coding a while with the Apple VM, Version 1.5 on Tiger but I found
it to be heavily underoptimized compared to the Sun Hotspot compiler.

I there an alternative implementation that is known to be faster?

Thanks for your admittance



robbieduncan
Jul 19, 2006, 04:39 AM
Not that I'm aware of. Sun do not distribute a JVM for OSX, I think the cooperate with Apple to release the "official" Apple one. I don't think the IBM one is available either.

aquanutz
Jul 19, 2006, 04:51 PM
robbieduncan is corret.

Desperado
Jul 20, 2006, 04:34 AM
That disappoints me. :(
How about the Intel-Version? Does it include the original Sun optimizations?

Nermal
Jul 20, 2006, 05:26 AM
Apparently Sun are going to open-source Java, once that happens you'll probably start to see more VMs popping up.

invalidname
Jul 20, 2006, 07:58 AM
I've been coding a while with the Apple VM, Version 1.5 on Tiger but I found it to be heavily underoptimized compared to the Sun Hotspot compiler.

Apple's JVM is licensed from Sun and already uses the HotSpot compiler:

[chrisg5:~] % java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)


Are you seeing slowness in GUI or server apps? GUI apps use Quartz so they may be slower but prettier than the same apps run on Windows or Linux.

You might try starting up with java -server or java -client to experiment with the JVM's compilation-versus-interpretation tradeoff options.

mrichmon
Jul 20, 2006, 10:20 AM
Apple's JVM is licensed from Sun and already uses the HotSpot compiler:

[chrisg5:~] % java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)



If the original poster is commenting about the Apple JVM running on PPC, then you are correct in saying that the JVM is already using HotSpot. However the PPC operation of the JIT is written by Apple developers working at Cupertino. Hotspot is geared towards x86 and SPARC just in time compilation. The minimal work that Apple does to get the JIT working on PPC isn't likely to result in optimal performance.

If the original poster is commenting about Apple JVM performance when running on Intel hardware then there are fewer reasons for bad performance. Presumably most, if not all, of the x86 JIT behavior can be directly reused on OS X for intel.

plinden
Jul 20, 2006, 10:54 AM
I hope the OP is talking about PPC (it helps to give details like this) because I found Java compilation and execution to be about three times faster on my 17" iMac (Intel 1.83GHz Core Duo) than on my colleague's 1.5 GHz PowerBook.

I find that it's about as fast at compiling in OS X on Intel Macs as it is in Linux (my previous OS of choice for Java programming), and about 50% faster than Windows, using the same machine for Linux and Windows (a laptop with a 2.26GHz Pentium M - the dual core doesn't affect the compilation time, and the slow Windows is most likely due to the on-access virus checker my employer forces me to use.)

valiar
Jul 20, 2006, 03:41 PM
Hello there

I've been coding a while with the Apple VM, Version 1.5 on Tiger but I found
it to be heavily underoptimized compared to the Sun Hotspot compiler.

I there an alternative implementation that is known to be faster?

Thanks for your admittance

"Underoptimized" as in...?
As previous posters have stated, Apple's JVM uses the same Hotspot JIT compiler as the Windows version does.
Both on my MacBook Pro and a dual 2.5GHz G5 Java apps feel completely native. For the record, I code in IntelliJ IDEA, run Azureus Bittorrent client, and a database program I have written myself.
On older G4 machines Java was indeed slow... But it was not the compiler's fault.

mrichmon
Jul 20, 2006, 03:49 PM
"Underoptimized" as in...?

Possibly because the JIT is designed to compile to x86 instructions. The PPC instructions that Apple modified the JIT to produce to replace the x86 instructions are very likely to be less than optimal for the high level operation being performed. This lack of optimization is likely because there isn't a clean mapping between x86 and PPC instructions.

Desperado
Jul 20, 2006, 04:19 PM
Yes, I referred to the Power PC Version. And I thought that only the client
hotspot was ported and not the server vm?