This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Speed Impact experiment on GCJ
Mark Wielaard writes:
> Hi Rui,
>
> On Wed, 2006-02-15 at 01:41 +0000, Rui Wang wrote:
> > Having compiled the code with -O3 flag, it runs much faster compare to
> > previous one. Thanks.
>
> Great. Please do post the results so people can compare with the
> unoptimized version. It is interesting to see how different ways to
> compile a program impact the speed.
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 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.