This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: first test
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: adm at m42 dot ch (Alessandro Di Maria)
- Cc: java at gcc dot gnu dot org
- Date: Wed, 14 Jul 2004 17:18:54 -0400 (EDT)
- Subject: 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
>
>
>