Results 1 to 4 of 4
  1. #1
    coldnebo is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default performance problem on osx

    Hi, I've been scouring google for any info on this, but haven't found anything. I'm hoping that maybe the odd java expert might know the reason for this...

    Here's a simple profile done on my windows laptop (running cygwin):
    $ time java -version
    java version "1.6.0_05"
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

    real 0m0.560s
    user 0m0.031s
    sys 0m0.015s


    Here's the same profile done on a dual G4 1GHZ mac server machine running leopard:

    $ time java -version
    java version "1.5.0_13"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
    Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

    real 0m47.108s
    user 0m0.114s
    sys 0m0.275s



    Can anyone tell me why the Mac is 46 seconds slower than pc (and linux) flavors of java?

    I'm trying to port ant build scripts over, but if it takes so long just to start ant up, it will really slow down the development cycle on this machine -- I'd almost rather setup a linux box instead.

    Thanks,
    -lk

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    How about testing the same version on two environments. If you can just try, then we can have a discussion about this. :)

  3. #3
    coldnebo is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default

    another comparison on Ubuntu, running against the 1.5.0_16 jre.

    larry@clover:~/Desktop/jre1.5.0_16$ time bin/java -version
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
    Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode, sharing)

    real 0m0.205s
    user 0m0.064s
    sys 0m0.064s

    note: this is a virtual machine running under a windows host, so it's performance if anything should be much worse.

    hotspot has worked fast for a long time on linux and windows, so I think there's something specific to the Apple implementation going on. Here's my top guesses...

    1) the command line tools generally invoke the class loader on a as-needed basis so one guess is that the Mac version of hotspot preloads the native Cocoa libs on startup regardless of whether they are used.

    But this doesn't sit well with experience... after all I saw more macs using java command line than you can shake a stick at, at places like JavaOne, etc. And that was all blazing fast.

    So
    #2) this mac is running leopard 10.5, but it's a dual G4. Could newly compiled java tools for leopard be intel binaries and somehow incurring a reverse emulation to older G4 hardware?

    Anyway, these are just guesses. I hope maybe someone in the community knows gritty details about the mac implemented hotspot and java toolchain.

    Thanks,
    -lk

  4. #4
    coldnebo is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default

    ok, the platform does seem to have something to do with it.

    I just got a macbook pro (personal laptop) intel core2 duo 2.4ghz, and I ran the same test.

    build 1.5.0_13-b05-237
    real: 0m0.565s

    awesome.

    So, maybe this is a problem with the binary translation layer ("Rosetta"?) going intel ==> g4

    Sure seems spiffy on the intel hardware.

Similar Threads

  1. CPU performance getting affected
    By peiceonly in forum Lucene
    Replies: 2
    Last Post: 10-06-2008, 09:24 PM
  2. Java Performance Ideas
    By developer321 in forum Advanced Java
    Replies: 4
    Last Post: 06-28-2008, 05:16 PM
  3. Performance Plugin
    By bugger in forum Eclipse
    Replies: 0
    Last Post: 01-31-2008, 03:01 PM
  4. Performance Of Collections
    By thomasprabu in forum Advanced Java
    Replies: 0
    Last Post: 01-05-2008, 12:17 PM
  5. how to improve the performance of JWS?
    By dinesh kaushik in forum Java Applets
    Replies: 0
    Last Post: 11-21-2007, 09:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •