This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: first test


> 
> Hello
> 
> After some days of compiling, I finally could start a first test:
> 
> public class Loop {
> 
>      public static void main(String[] args) {
>          long before = System.currentTimeMillis();
>          for (int i=0; i < 1000000; i++){
>              int a = 27 + 3 * i;
>              String b = String.valueOf(a) + "hello";
>          }
>          long after = System.currentTimeMillis();
>          System.out.println("time: " + (after-before));
>      }
> 
> }
> 
> running it on Mac OS X 10.3.4 1.33 GHz G4:
> 
> java Loop
> time: 2269
> 
> gcj --main=Loop -o Loop Loop.java
> ./Loop
> time: 4369
> 
> ??? the app compiled with gcj is twice as much slow as the one running 
> through the VM ???
> Redoing the test doesn't change much.
> 
> Have I done something wrong?
Yes compiled the program at -O0 rather than -O2.

Andrew


> 
> Gruz
> Alessandro
> 
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]