first test
Andrew Pinski
pinskia@physics.uc.edu
Wed Jul 14 21:18:00 GMT 2004
>> 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
>>>
More information about the Java
mailing list