PDA

View Full Version : Java on Intel Macs




adrianm
Feb 22, 2006, 12:33 AM
I've heard very little on the subject of Java performance on the new Intel-based Macs.

Sounds suspicious to me. If it was good, then I'd have thought Apple would be shouting it loud and clear, especially since it's easy to compare VM performance between identical (ish) hardware but running different OS/VM combos (xp/linux with ibm/sun, osx with apple).

Anyone shed any light on this?



caveman_uk
Feb 22, 2006, 04:42 AM
Well it's crap on the PPC macs so I wouldn't expect much if I were you.

Cue
Feb 22, 2006, 07:06 AM
Well it's crap on the PPC macs so I wouldn't expect much if I were you.

Any evidence to back this up? :/

mwpeters8182
Feb 22, 2006, 08:08 AM
Any evidence to back this up? :/

Java is much, much slower on the Mac than Windows. I have a hard time believing you've never noticed.

http://www.jole.fi/JavaPerformanceTest/

Edit: The G5 seems to be much better at Java than the G4. Damn, I wish I had one. Java's terrible on my PB.

jtalerico
Feb 22, 2006, 08:11 AM
Java is much, much slower on the Mac than Windows. I have a hard time believing you've never noticed.

Nope, I have noticed that my Dual G5 handles java much better

Spies
Feb 22, 2006, 08:34 AM
How can this test be run on a windows machine? Just curious.

mwpeters8182
Feb 22, 2006, 09:23 AM
I'm not sure it can, I think that was run on linux - I threw it up there for a comparison between hardware, but forgot to mention. I'm trying to find a better benchmark now.

mwpeters8182
Feb 22, 2006, 09:44 AM
http://www.macintouch.com/imacintel/bench.html

Here's what you were looking for.

adrianm
Feb 22, 2006, 12:28 PM
http://www.macintouch.com/imacintel/bench.html

Here's what you were looking for.

Not quiet :) but thanks anyway. This just looks like a number crunching benchmark; I'm more interested in GC efficiency, lock contention performance, heavy thread scheduling performance, etc.

I've found that my dual G5 2.5ghz consistently out-perform the Intel blades we use at work (Linux or XP) and under very heavy load conditions.

Running this particular test on my Mac: 251.7.

The Core Duo gets 228.4, so I suppose they're pretty even per core, with the 1.5 year old G5 just a bit quicker.

I'd expect this to improve over time.

Cue
Feb 22, 2006, 02:23 PM
Java is much, much slower on the Mac than Windows. I have a hard time believing you've never noticed.


I don't have a Mac, thats why Im asking! :)

mwpeters8182
Feb 22, 2006, 03:21 PM
I don't have a Mac, thats why Im asking! :)

Oh, I thought you had one and didn't notice :-). I've had people argue the opposite, even having both.

At least with the G4s, Java can be awful to use on occasion.

plinden
Feb 22, 2006, 03:32 PM
I'm a Java developer and I'm extremely pleased with Java performance on my Intel iMac ... compilation anyway. I haven't properly tested runtime performance. I'm only really concerned with compilation since my apps will be installed on Linux servers anyway.

For compiling the same project:
Dell Latitude 2.26GHz D810, 2GB RAM
60 seconds using Windows XP
39 seconds using Fedora Core 3

Intel iMac 17" 1.83GHz, 2GB RAM:
40 seconds

Although this may seem disappointing for a dual core at first glance, javac only uses one core, so this is comparing a single 1.83GHz CPU to a single 2.26GHz CPU.

While importing CD into iTunes:
8 minutes on Dell using Windows XP
42 seconds on iMac

For comparison, my Dell compiles the same project almost twice as fast as my colleagues 1.5GHz G4 PowerBook so there should be a 3-4x speed up with the Intels.

Edit: and yes, I need to do some serious runtime testing, but haven't got around to it yet.

plinden
Feb 22, 2006, 03:38 PM
How can this test be run on a windows machine? Just curious.
I ran that test on my Windows machine no problem - it's just using ant to compile. I got results roughly in line with that on my PC laptop (taking into account the difference in CPU) and with the same ratios as the tests I mentioned in my other post.

adrianm
Feb 22, 2006, 04:23 PM
I ran the ant test on my 2.5ghz x2 G5.

Took 15 seconds.

Not great really.

But then, on my G5, I'd do parallel builds with ant (using parallel task) so that would speed things up over 2 cores.

As an aside, I often do Xcode Obj-c work at home and do that on my 12" iBook in front of the TV watching football, and using the xcode distributed build system to let my G5 do the donkey work.

That's cool :)

As a laugh, I ran the ant test twice in parallel. Combined took 19 seconds.

Generally this proves that small builds take little time regardless of platform. Big builds, in parallel, are more demanding of bus/disk io/number of cores, etc. At work, a full build of our system on my single core xp 3.2ghz P4 takes 24 mins from local disk. My G5 Mac does it in 16.

So to people who say that Java on the Mac is slow - I disagree in (my) real world. But I'm still keen to know if a lowly dual core Intel Mac will better my PM. Looks like it won't, but gets close.

Dual core macs look like good value, then.

plinden
Feb 22, 2006, 04:38 PM
I ran the ant test on my 2.5ghz x2 G5.

Took 15 seconds.

My 2.26GHz laptop running Linux and dual core 1.83GHz iMac both take 13 seconds. I can't be bothered to boot into Windows to test it but it was about 20 seconds when I did it. I should try with a larger project but I'm just starting a new one now so don't have a lot to compile.

Stella
Feb 22, 2006, 06:02 PM
Any evidence to back this up? :/


Apple implementation of Java is horrid. Its super slow... very disappointing. I, too, hope that the Intel Macs have improved Java performance ( just because they are much faster processors).

Eclipse on my G4 1.67 is just about usable. No problems under Windows, it flies. It doesn't help that SWT doesn't work with AWT.. thus a lot of Eclipse plugins won't work under OSX. Eclipse may be large, but its not slow ( on windows or Linux ).

Apple want the Mac to be a good Java platform... they have a long way to go.

Generally, its well known that Apple's Java isn't that good ( performance wise ). Sun won't support Macs, Apple have to do it themselves. Saying that, Apple have optimised Java for Macs in various ways.. but doesn't help the general performance.

bnash
Feb 23, 2006, 02:33 AM
I just got my intel Mac yesterday and tried Eclipse 3.1.2 and wasn't too pleased with the speed. I found that the newer development release 3.2.0 M5 is *much* faster. It's a universal binary and runs much faster than the older PowerPC version 3.1.2 which (presumably) runs in Rosetta emulation. I should mention that it's a very vanilla intall, many plug-ins won't work until (or nearly until) the final release of 3.2. I was able to use the SVN subclipse plug-in which has been helpful. Anyone else tried this version?

Cue
Feb 23, 2006, 04:21 AM
Apple implementation of Java is horrid. Its super slow... very disappointing.

Eclipse on my G4 1.67 is just about usable.

I just got my intel Mac yesterday and tried Eclipse 3.1.2 and wasn't too pleased with the speed. I found that the newer development release 3.2.0 M5 is *much* faster.

Where were you guys when I made this post (http://forums.macrumors.com/showthread.php?t=180395)? :)

mbabauer
Feb 23, 2006, 08:11 PM
How can this test be run on a windows machine? Just curious.

Java, for what its worth, is an "interpreted" language. They don't like to say that, as the word interpreted has connotations, like its totally text, which its not.

Java files are compiled into something refered to as "byte code", which is a binary file that comprises your code. Basically, the big promise with Java is "write once, run anywhere".

So, code that is written on an Os X machine "should" be able to run on ANY Java Virtual Machine (jvm) on ANY platform (windows, os/2, os/390, mac, linux, etc). This in theory is correct, but not always true in practice, but I would say it works 97% of the time.

EDIT: BTW, for what its worth, I would think the JVM would get better now the Macs are intel-based. Not that the G4/G5 are bad, but there are a lot of JVMs out there, including the ones for sun, already compiled and ready for Intel platforms. As Sun themselves have a Linux x86 JVM thats pretty darn good, and Linux and OsX share a similar *nix ancestry, I would think porting that one over would not be that bad. Question is, would Apple do it, seeings there is probably a small handful of true Java developers on Mac...just my $0.02 worth.

plinden
Feb 23, 2006, 11:23 PM
Where were you guys when I made this post (http://forums.macrumors.com/showthread.php?t=180395)? :)
None of us had Intel Macs back than. I've come across several throw-away comments in forums and blogs that said that Intel Mac java performance was 2x-3x better - compared to what CPU, I don't know. All I know is that in my experience compilation is much faster, even than on my Windows machine, and is comparable to Linux on a 25% faster CPU.

Ok, I don't use Eclipse for development, but I'm willing to download and try it out and see if it's usable.

Edit: Of course, as bnash said, eclipse 3.1.2 is a PPC, so perhaps I'll not bother downloading that 98MB file. I'll stick to the command line.

Cue
Feb 24, 2006, 07:09 AM
None of us had Intel Macs back than.

The post is actually referring to an iBook :)

Converted2Truth
Feb 28, 2006, 08:32 PM
I bought a 1.67ghz G4 powerbook because i thought java performance would be twice that as it was on my Ti800mhz. When i got it, java performance was almost identical. I was pissed. So i ebay'd that one too. Now i have no powerbook/macbook, and am waiting for an apple laptop that can run netbeans with the following conditions...

-can display methods that i'm typing before i finish typing them.
-can compile trivial (<100k of .java) in about a second.

all i want is a SNAPPY java IDE. So far, i've only been able to experience this on my PentiumD 3.2ghz and DP1.8ghz G5 (although the Pentium spanks it).

Can anyone testify to the SNAPPINESS of netbeans on a macbook pro (2ghz)?

PLEASE O PLEASE, someone tell me if this mac delivers...

Soulstorm
Mar 1, 2006, 05:20 AM
I had heard that from now on, java framework will not be developed as other frameworks do, such as Carbon and Cocoa.

Is that true?

caveman_uk
Mar 1, 2006, 05:30 AM
The java bridge to the cocoa frameworks isn't been updated any more and no new features are being added.

rehlers
Mar 1, 2006, 07:28 AM
While I've never done a head-to-head comparison of Java applications between Mac and Windows, I do run quite a few large java applications on a frequent basis. I had been using a Mac Mini G4 1.5Ghz w/1GB ram. I use moneydance (java quicken-like application) and triplea (java axis and allies game) quite a bit. I never really had a problem with the performance of them on the Mac Mini. I guess they were a little sluggish feeling, but more Java applications on any platform are. I now have a MacBook Pro and playing around in TripleA, it feels much more responsive, I'd say its at least 2-3x better. Of course that could be due to the faster CPU more than better Java. I'm quite happy with it.

Converted2Truth
Mar 1, 2006, 10:41 AM
So are you guys saying that i should not even be programming java on the mac because it uses a GUI bridge to Cocoa? and won't be updated?

I don't think windows uses a UI bridge... cause the java windows look totally different (which i like actually).

therevolution
Mar 1, 2006, 11:09 AM
So are you guys saying that i should not even be programming java on the mac because it uses a GUI bridge to Cocoa? and won't be updated?

I don't think windows uses a UI bridge... cause the java windows look totally different (which i like actually).
No. AWT/Swing is not tied to Cocoa. What he's saying is that there's an optional Java->Cocoa bridge that lets you leverage some of the Cocoa APIs in Java. Apple stopped updating this bridge, so the latest Cocoa features are not supported. If you're doing pure Java, though, it's a non-issue.

Converted2Truth
Mar 2, 2006, 01:30 PM
k, just one last question: Has apple/sun come out with a native x86 JRE for the new intel macs?

You are all saying that you see a performance increase, but is it still going through rosetta?

plinden
Mar 2, 2006, 01:41 PM
k, just one last question: Has apple/sun come out with a native x86 JRE for the new intel macs?

You are all saying that you see a performance increase, but is it still going through rosetta?
The JRE is native. It's as fast compiling on my 17" Intel iMac (1.83GHz Core Duo, 2GB RAM) as on a 2.26GHz, 2GB RAM, Pention M Dell laptop running Fedora Core 3 and 50% faster than the same Dell laptop running Windows. I don't use any IDE (I'm a command line junkie) so can't give you any hints on how any IDE works. If you really want to know, I'll install netbeans tonight and try it out - I'm interested myself ...

Converted2Truth
Mar 2, 2006, 01:50 PM
The JRE is native. It's as fast compiling on my 17" Intel iMac (1.83GHz Core Duo, 2GB RAM) as on a 2.26GHz, 2GB RAM, Pention M Dell laptop running Fedora Core 3 and 50% faster than the same Dell laptop running Windows. I don't use any IDE (I'm a command line junkie) so can't give you any hints on how any IDE works. If you really want to know, I'll install netbeans tonight and try it out - I'm interested myself ...
That would be awesome.

Oh, and the only reason that i use an IDE is because hitting a button is alot faster than typing "javac ...." in a terminal. Maybe i would be more inclined to be a command line coder if i was really proficient at using vi or some other text editor that i could run in a terminal. So far, i only really use pico... and i don't really like that...

thanks for looking into this for me! look forward to the results :)

plinden
Mar 2, 2006, 02:12 PM
Oh, and the only reason that i use an IDE is because hitting a button is alot faster than typing "javac ...." in a terminal.
Actually, I find typing "ant build" followed thereafter by "!a" faster than lifting my hand off the keyboard grabbing the mouse and moving the cursor to a button on the screen, but then I'm really old school with this. I learned to program in college on a Vax mainframe back in 1984, where we were limited to one hour/week access, in a terminal room, where to get access to the login prompt would take 15 minutes of continually pressing "Enter". vi was a huge step up from edlin.


Edit: Ok, downloaded and installed NetBeans. I don't have a lot of time to play about with it tonight, but it's a native Intel application and seems pretty snappy to me. I was able to create a new project with my my latest webapps code, then build and deploy it in 12 seconds. Ok, there's not a lot of code there (just 44 classes) but that's a good deal quicker than my using the command line (having to copy the war file over and waiting for Tomcat to reload the webapp).

So I'd say you have nothing to worry about with Java on the Intel iMacs. I'm certainly extremely impressed with what they've managed to do.

misfit
Mar 3, 2006, 02:33 PM
What about this program? It should run on a Mac but it doesn't, it won't even start.
The sourcecode is available here : https://sourceforge.net/projects/geeboss/ . Is there a way for someone to edit this java based editor, so Mac-guitarists/GT-8 owners can use this? It can't be too hard for a Java programmer,
it's not from scratch, but the author is only PC-based, so he doesn't know where the Mac-bug is. The major issue is, we can't exchange patches on the GT-8, which is a guitar-multi-effect pedal with midi-implementation.

I guess you have to own such a pedal to check it, but not wanting to start is another issue I think