Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > java performance on 10.4 - numbers

java performance on 10.4 - numbers
Thread Tools
I was David B.
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status: Offline
Reply With Quote
May 15, 2005, 05:50 PM
 
I did some measurements to find out if java execution speed has been increased with Tiger. Compared to linux and windows systems java was always slow on OS X. So I hoped that this is going to change sometimes.

I have performed 6 tests:

1. decompression of a zip compressed file directly from a java class and putting the results into a container classes (mainly decompression, loops and array access).
2. decompression of this file calling java classes from a jython commandline. In my project we do this frequently so it is interesting for me.
3. visualisation of the decompressed data using java2d (I used a MemoryImageSource producing a BufferedImage). The data consists of thousands of image data in the form of integer arrays that can be rendered and shown in a sequence (like a film). I measure the number of BufferedImages per second that java can display. Each image has a typical size of 350X450 pixels.
4. an algorithm that calculates Pi using the BigDecimal class rounded to 250 decimals. The results of Pi and the time for an iteration are shown in a swing gui.
5. an algorithm that calculates Pi using doubles. The results are shown in the terminal.
6. to compare speed I also programmed the Pi - double algorithm in c

I tested on my Powerbook 1GHz/G4/12 inch with 768 MB RAM. Both OS 10.3 and OS 10.4 were installed on different partions of an external Samsung 160GB/7200 rpm firewire 400 drive.
The linux comparison was done with an IBM Thinkpad T40 with a 1.6 GHz Pentium M and 1GB of RAM and a Hitachi 2.5 inch/40GB/5400 rpm hd.

The results:
java 1.4.2 on OS 10.3.8
1. 29.4 sec
2. 221 sec
3. 10 Frames/sec
4. 290 ms for 2000 iterations
5. 230 ms for 1,000,000 iterations
6. 50 ms for 1,000,000 iterations

java 1.4.2 on OS 10.4.0
1. 26.6 sec
2. 186 sec
3. 10 Frames/sec
4. 290 ms for 2000 iterations
5. 193 ms for 1,000,000 iterations
6. 50 ms for 1,000,000 iterations

java 1.5 on OS 10.4.0
1. 28.9 sec
2. 200 sec
3. 8 Frames/sec
4. 1023 ms for 2000 iterations
5. 201 ms for 1,000,000 iterations
6. 50 ms for 1,000,000 iterations

sun java 1.4 on Suse linux 9.2 running on a IBM Thinkpad T40 (1.6 Ghz centrino)
1. 11.8 sec
2. 136.5 sec
3. 14 Frames/sec
4. 200 ms for 2000 iterations
5. 49 ms for 1,000,000 iterations
6. 40 ms for 1,000,000 iterations

ibm java 1.4 on Suse linux 9.2 running on a IBM Thinkpad T40 (1.6 Ghz centrino)
1. 9.2 sec
2. 113.0 sec
3. 14 Frames/sec
4. 120 ms for 2000 iterations
5. 57 ms for 1,000,000 iterations
6. 40 ms for 1,000,000 iterations


This shows that under OS 10.4 java execution speed has improved slightly (10-15%) for java 1.4. I think this matches the overall improvement of programm execution speed on OS 10.4 compared to 10.3. But compared to a linux machine that performs roughly like my Powerbook (look at the c results - they are similar), the apple jvm is still a factor of 1,5 - 2 behind.

I hope this will improve sometime. But java 1.5 on Mac OS shows that apple decided to become even slower. Look at the terrible BigDecimal results - 3 times slower than before. I hope this is only due to the new pre release of java 1.5 that has been released too early and it will become faster than 1.4 in the end. On linux java 1.5 IS faster than 1.4 (but I skipped quantitative tests).
It is a situation where nobody who is sane will choose Mac OS as a platform for java programs. Programming is great on a mac but for execution Macs are still the slowest platform available. Bummer, isn't it?


Edit
####
I have also a Yellow Dog Linux installation on my Powerbook. It runs on a IBM virtual machine (1.4.2) for power pc. But it uses the instruction set of the firtst power pc because the ibm vm does not support the G4 processor directly.
This allows a direct comparison of Mac java and linux java.
Results are

1. 16.4 sec
2. 90 sec
3. 10 Frames/sec
4. 332 ms for 2000 iterations
5. 95 ms ms for 1,000,000 iterations
6. 90 ms for 1,000,000 iterations

The last comparison shows that even with an old processor instruction set, the ibm virtual machine knocks down the latest apple vm. The rendering speed is the same (10 frames/sec) although I don't have hardware accelerated rendering on yellow dog linux. On MacOSX the rendering is done by the graphics card, not by the processor.
( Last edited by I was David B.; May 30, 2005 at 04:45 AM. )
     
tkmd
Grizzled Veteran
Join Date: Oct 2001
Location: Michigan
Status: Offline
Reply With Quote
May 15, 2005, 09:40 PM
 
Thanks for the insight - very informative.
Pismo 400 | Powerbook 1.5 GHz | MacPro 2.66/6GB/7300GT
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 17, 2005, 10:37 PM
 
Tell Apple about it on http://radar.apple.com/ and send them these results. This is pissing me off too. Especially when they claim **** like this:
Apple has optimized Java on Mac OS X to look great and perform superbly, making Mac OS X the ultimate platform for developing and deploying cross-platform Java applications.
( Last edited by itistoday; May 19, 2005 at 06:43 PM. )
     
geran
Forum Regular
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 19, 2005, 06:26 PM
 
Originally Posted by itistoday
But Apple about it on http://radar.apple.com/ and send them these results. This is pissing me off too. Especially when they claim **** like this:
What are you pissed off about? That the performance has improved? Or that the PC was faster, that might have something to do with its faster (1.6Gzh vs. 1Ghz) ...
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 19, 2005, 06:46 PM
 
Originally Posted by geran
What are you pissed off about? That the performance has improved? Or that the PC was faster, that might have something to do with its faster (1.6Gzh vs. 1Ghz) ...
What? According to his numbers performance with Java 1.5 has actually gotten worse. And I hope you're not using megahertz compare processors... Last I heard the G4 and Pentium Centrino were not comparable (I think, though I'm not positive, that the G4 is faster).
     
I was David B.  (op)
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status: Offline
Reply With Quote
May 20, 2005, 06:59 AM
 
Originally Posted by itistoday
What? According to his numbers performance with Java 1.5 has actually gotten worse. And I hope you're not using megahertz compare processors... Last I heard the G4 and Pentium Centrino were not comparable (I think, though I'm not positive, that the G4 is faster).

I have updated the numbers now for yellow dog linux. This leaves Apple standing in a quite dark light.

Well MHz? It was apple who started to talk about the megahertz myth. The claimed their processors are faster due to a clever architecture although they run with lower clock speed. Seems that THIS is the real myth .

Frustrating results, isn't it?


Edit
####
Just to give a summary for the ones of you who don't like to read so much data columns:

java 1.4 on 10.4 is a little bit faster or as fast in every tested aspect compared to java 1.4 on OS 10.3.
Java 1.5 is slower in every tested aspect compared to java 1.4 (both on OS 10.4).
Java 1.4 on linux for power pc is faster in nearly every tested aspect compared to java 1.4 on OS 10.4.
Java 1.4 on a linux running Pentium M is comparable to the fastest java on ppc (linux) if the clockspeed difference is used as a factor.

Either java on linux for power pc and java on linux for X86 blows away Apples java implementation for every single test that has been performed.

The very end result:
###############
Apples hardware is as effcient as a Pentium M if clockspeed difference is taken into account.
Apples java implementation/or OS implementation is slower than it could be, even for the latest Mac OS 10.4.

So please TUNE A LITTLE BIT MORE.
( Last edited by I was David B.; May 30, 2005 at 04:49 AM. )
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 20, 2005, 04:11 PM
 
Originally Posted by I was David B.
I have updated the numbers now for yellow dog linux. This leaves Apple standing in a quite dark light.

Well MHz? It was apple who started to talk about the megahertz myth. The claimed their processors are faster due to a clever architecture although they run with lower clock speed. Seems that THIS is the real myth .

Frustrating results, isn't it?
Wow, that is pathetic... Did you try contacting apple with these results? Perhaps you should put up a webpage, it could even make slashdot I bet (I've seen worse stories).
     
I was David B.  (op)
Registered User
Join Date: Jan 2005
Location: there are days when I wake up and thats exactly my question
Status: Offline
Reply With Quote
May 21, 2005, 09:50 AM
 
Originally Posted by itistoday
Wow, that is pathetic... Did you try contacting apple with these results? Perhaps you should put up a webpage, it could even make slashdot I bet (I've seen worse stories).

Thanks for your comments.
I will not set up a website. I did this comparison mainly to find out if it is worth to spend money on OS 10.4 if only java is the thing to decide upon.

And I don't want to trash apples image. I want to show that their marketing ignores facts and I want to give a thorough base for a decision.
(BTW. Do you know marketing guys that use facts without distorting them first? I don't. Thats not an excuse, they don't deserve it, but everybody has to be aware that it is best to ignore marketing and advertisement. Just make up your mind yourself. I hope this thread helps a little bit).

The result shows that you can have decent performance on a Mac if you run linux. So a Mac is a good decision. At least you have all options. I also like to develop java on Mac OS. The performance is only one aspect. But the environment with all the great supporting applications (BBedit, emacs, Mac Office, Launchbar, iTunes etc.) makes the overall experience significantly superior to development on linux. - Linux can really suck, just to have that pointed out very clearly.

But... (you know what comes here).
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 21, 2005, 11:25 AM
 
Yeah I agree. I don't mean to come off sounding like I'm trashing Apple, I'm just thoroughly disappointed with these results. It's really sad when YDL beats OS X in terms of java performance. However, one thing that is nice about Java on OS X is, as you said, the environment. All jars are double-clickable and the runtime environment is installed by default (unlike Windows). It also has the great ~/Library/Java/Extensions folder that I find extremely useful. And who can forget Cocoa-Java? I just don't see any reason that java should be this slow, that's all.
     
Gregory
Grizzled Veteran
Join Date: Sep 1999
Status: Offline
Reply With Quote
May 21, 2005, 12:17 PM
 
Okay, 1.5 is slow.

I assume that it has debug code. That wouldn't surprise me.

Or that the IBM 970 and Tiger hasn't fully exploited what AltiVec on G4 could do.

Don't tell Giga Designs that GHz is a myth! They have some great G4 upgrades lined up (and people lining up to buy) their 1.8DP and 2.0GHz 74xx.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 21, 2005, 06:02 PM
 
Originally Posted by Gregory
I assume that it has debug code. That wouldn't surprise me.
Are you serious?
     
Ghoser777
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 22, 2005, 10:16 AM
 
LONG LIVE DEBUG CODE! The cause of, and solution to, all of programming's problems.
     
AndyKorth
Fresh-Faced Recruit
Join Date: Jun 2005
Status: Offline
Reply With Quote
Jun 15, 2005, 11:46 AM
 
In my experience, Java 1.5 is much slower in Graphics.drawImage().

In fact, my application's rendering loop went from 7ms to 300 ms... Quite unacceptable. The only difference was running in the 1.5 vm, Tiger.

To see this in action, go visit;
http://sourceforge.net/projects/tyrant/
And download the jar from
http://prdownloads.sourceforge.net/t...4.jar?download
Try running the jar in Java 1.4 and then in 1.5.

The speed difference is extremely obvious. I guess I should report this as a performance regression... However, apple's bug page leaves much to be desired..
     
TampaDeveloper
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Jun 15, 2005, 01:34 PM
 
Yeah, thats very bad. I've know about Apples performance woes with Java for 1.5 years now. I just assumed that eventually they would figure out what the problem was. I guess not.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:20 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,