Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 19, 2006, 04:10 AM   #1
Desperado
macrumors newbie
 
Join Date: May 2005
Alternative to Apple Java VM?

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
Desperado is offline   0 Reply With Quote
Old Jul 19, 2006, 04:39 AM   #2
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
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.
robbieduncan is offline   0 Reply With Quote
Old Jul 19, 2006, 04:51 PM   #3
aquanutz
macrumors regular
 
Join Date: May 2005
Location: Boston, MA (I miss Willoughby, Ohio)
robbieduncan is corret.
aquanutz is offline   0 Reply With Quote
Old Jul 20, 2006, 04:34 AM   #4
Desperado
Thread Starter
macrumors newbie
 
Join Date: May 2005
That disappoints me.
How about the Intel-Version? Does it include the original Sun optimizations?
Desperado is offline   0 Reply With Quote
Old Jul 20, 2006, 05:26 AM   #5
Nermal
Moderator
 
Nermal's Avatar
 
Join Date: Dec 2002
Location: Whakatane, New Zealand
Apparently Sun are going to open-source Java, once that happens you'll probably start to see more VMs popping up.
Nermal is online now   0 Reply With Quote
Old Jul 20, 2006, 07:58 AM   #6
invalidname
macrumors member
 
Join Date: May 2003
Location: Grand Rapids, MI
You're already using HotSpot

Quote:
Originally Posted by Desperado
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.
invalidname is offline   0 Reply With Quote
Old Jul 20, 2006, 10:20 AM   #7
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by invalidname
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.
mrichmon is offline   0 Reply With Quote
Old Jul 20, 2006, 10:54 AM   #8
plinden
macrumors 68040
 
plinden's Avatar
 
Join Date: Apr 2004
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.)
plinden is offline   0 Reply With Quote
Old Jul 20, 2006, 03:41 PM   #9
valiar
macrumors regular
 
Join Date: Mar 2006
Location: Berkeley, CA
Send a message via ICQ to valiar
Quote:
Originally Posted by Desperado
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.
valiar is offline   0 Reply With Quote
Old Jul 20, 2006, 03:49 PM   #10
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by valiar
"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.
mrichmon is offline   0 Reply With Quote
Old Jul 20, 2006, 04:19 PM   #11
Desperado
Thread Starter
macrumors newbie
 
Join Date: May 2005
Yes, I referred to the Power PC Version. And I thought that only the client
hotspot was ported and not the server vm?
Desperado is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Java 6.x security risk (?) vs Java 7.x and broken apps w/ v7.x installs? mgiamo Mac Basics and Help 1 Dec 15, 2013 03:48 PM
Apple Releases New Java 6 Updates With Enhanced Security, Uninstalls Apple-Provided Java Applet Plug-in MacRumors Mac Blog Discussion 49 Oct 22, 2013 09:58 AM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
Installed Java 7.07 but doesn't show up in Java preferences? -mattias- OS X 10.8 Mountain Lion 21 Aug 31, 2012 04:49 PM
alternative to JDownloader (Open Source, Java)? Quotenfrau Mac Applications and Mac App Store 0 Aug 11, 2012 11:56 AM

Forum Jump

All times are GMT -5. The time now is 03:54 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps