Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Desperado

macrumors newbie
Original poster
May 10, 2005
17
0
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

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

Desperado

macrumors newbie
Original poster
May 10, 2005
17
0
That disappoints me. :(
How about the Intel-Version? Does it include the original Sun optimizations?
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,638
4,036
New Zealand
Apparently Sun are going to open-source Java, once that happens you'll probably start to see more VMs popping up.
 

invalidname

macrumors member
May 1, 2003
64
9
Grand Rapids, MI
You're already using HotSpot

Desperado said:
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:

Code:
[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
Code:
java -server
or
Code:
java -client
to experiment with the JVM's compilation-versus-interpretation tradeoff options.
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
3
invalidname said:
Apple's JVM is licensed from Sun and already uses the HotSpot compiler:

Code:
[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

macrumors 601
Apr 8, 2004
4,029
142
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

macrumors regular
Mar 14, 2006
222
0
Washington, DC
Desperado said:
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

macrumors 6502a
Jun 17, 2003
873
3
valiar said:
"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

macrumors newbie
Original poster
May 10, 2005
17
0
Yes, I referred to the Power PC Version. And I thought that only the client
hotspot was ported and not the server vm?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.