This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Speed Impact experiment on GCJ
Andrew Haley wrote:
I tried gcj against IBM's JIT -- still the fastest JIT AFAIAA.
(Disclaimer: this is an old 32-bit version of IBM's JIT, and a newer
one may be better.)
I made some similar tests using the HotSpot 1.5.0_06 server JVM on a Fedora Core release 4.
As you can see, my gcj is slightly older then yours. Don't know how much that matters.
Results below:
Regards,
Thomas Hallgren
[thhal@localhost gcjtest]$ gcj --version
gcj (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[thhal@localhost gcjtest]$ java -version -server
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
HotSpot server without JIT:
[thhal@localhost gcjtest]$ time java -server -Djava.compiler=none Client task.test servers.d
result.d
real 0m55.379s
user 0m53.726s
sys 0m1.379s
200.0 7897
300.0 11791
400.0 15660
500.0 19588
HotSpot server JIT:
[thhal@localhost gcjtest]$ time java -server Client task.test servers.d result.d
real 0m0.510s
user 0m0.073s
sys 0m0.393s
200.0 39
300.0 1
400.0 0
500.0 1
REMARK: Obviously, the JIT discovers that the loop is not really a loop sometime
during the first iterations and decides to optimize pretty hard...
gcj at -O0:
[thhal@localhost gcjtest]$ time ./client task.test servers.d result.d
real 0m9.609s
user 0m9.240s
sys 0m0.288s
200.0 1327
300.0 2053
400.0 2662
500.0 3339
gcj at -O3:
[thhal@localhost gcjtest]$ time ./client task.test servers.d result.d
real 0m1.469s
user 0m1.265s
sys 0m0.202s
200.0 184
300.0 276
400.0 346
500.0 442
I get:
[aph@zorro ~]$ java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM build cxia32142-20041210 (JIT enabled: jitc))
[aph@zorro ~]$ gcj --version
gcj (GCC) 4.1.0 20060128 (Red Hat 4.1.0-0.17)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
IBM without a JIT:
[aph@zorro ~]$ time java -Djava.compiler=none Client task.test servers.d result.d
Warning: JIT compiler "none" not found. Will use interpreter.
real 1m6.508s
user 1m6.340s
sys 0m0.016s
200.0 9315
300.0 13993
400.0 18636
500.0 23271
IBM with a JIT:
[aph@zorro ~]$ time java Client task.test servers.d result.d
real 0m2.521s
user 0m2.480s
sys 0m0.024s
200.0 334
300.0 501
400.0 671
500.0 835
gcj at -O0:
[aph@zorro ~]$ time ./client task.test servers.d result.d
time ./client task.test servers.d result.d
real 0m6.982s
user 0m6.932s
sys 0m0.024s
200.0 997
300.0 1475
400.0 1988
500.0 2491
gcj at -O3:
[aph@zorro ~]$ time ./client task.test servers.d result.d
real 0m1.236s
user 0m1.220s
sys 0m0.016s
200.0 167
300.0 252
400.0 336
500.0 425
32-bit mode doesn't seem to make any difference to us. gcj at -O3 -m32:
[aph@zorro ~]$ time ./client task.test servers.d result.d
real 0m1.236s
user 0m1.228s
sys 0m0.008s
200.0 167
300.0 251
400.0 335
500.0 418
And, just for laughs, gij:
[aph@zorro ~]$ time gij Client task.test servers.d result.d
real 0m41.280s
user 0m41.047s
sys 0m0.024s
200.0 5804
300.0 8685
400.0 11587
500.0 14468
Andrew.