Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Performance in MAC OS X



 I forgot to say which the VM that I am using in my MAC (iBook 1.2 768 MB RAM - MAC OS X 10.4.7)
 
VMs:
1.3.1_09-82
1.4.2-54
1.5.0_06-64
1.6.0-b82-3
 
In the VM 1.6.0-b82-3 the time of execution was: 397899ms !!!! for String code.
Carlos

 
On 7/18/06, Carlos Santiago <email@hidden> wrote:
People,
I agree to the you comments.
However what I am trying to show it is not a comparison of performance between two the hardware and yes the great difference that exists in time of execution between different versions of one VM of the Sun. 
Observing the data in annex, they do not agree that one VM with version 1.3 or 1.4 has a better performance of what one 1.5? 
Another detail, hardwares is different yes, and knows that this influence, but to the point of the same program in "supposed" a version of VM to be until 10x slower?
It does not sound as strange? 
Below it follows the codes that I executed, if somebody will have time could make the verifications. 
Carlos
 
 
public class Main {
   
    /** Creates a new instance of Main */
    public Main() {
    }
   
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
       String string = "";
      
       long a = System.currentTimeMillis();
      
       for(int i = 0; i < 100000; i ++)
           string += 'a';
      
       System.out.println ((System.currentTimeMillis() - a));
      
       //System.in.read();
    }
}
 
-----------------------------------------------------------------------------------------------------------------
 
public class Main2 {
   
    /** Cria uma nova instância de Main2 */
    public Main2() {
    }
    public static void main(String[] args) throws Exception{
       StringBuffer buffer = new StringBuffer();
      
       long a = System.currentTimeMillis();
      
       for(int i = 0; i < 100000; i ++)
           buffer.append('a');
      
       System.out.println((System.currentTimeMillis() - a));
      
       //System.in.read();
    }    
}
-------------------------------------------------------------------------------------------------------
public class Main3 {
   
    /** Cria uma nova instância de Main3 */
    public Main3() {
    }
   
   public static void main(String[] args) throws Exception{
       StringBuilder builder = new StringBuilder();
       long a = System.nanoTime();
      
       for(int i = 0; i < 100000; i ++)
           builder.append('a');
      
       System.out.println((System.nanoTime() - a)/1000000);
      
       //System.in.read();
    }
}

------------------------------------------------------------
Carlos Santiago
Analista de Dados - META
Programador Java - SCJP 1.4
JCP Member
Blog: http://macjava.blogspot.com
------------------------------------------------------------




--
------------------------------------------------------------
Carlos Santiago
Analista de Dados - META
Programador Java - SCJP 1.4
JCP Member
Blog: http://macjava.blogspot.com
------------------------------------------------------------
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Java Performance in MAC OS X (From: "Carlos Santiago" <email@hidden>)
 >Re: Java Performance in MAC OS X (From: Bill Wagner <email@hidden>)
 >Re: Java Performance in MAC OS X (From: "Carlos Santiago" <email@hidden>)
 >Re: Java Performance in MAC OS X (From: Niels Meersschaert <email@hidden>)
 >Re: Java Performance in MAC OS X (From: "Carlos Santiago" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.