LWN.net Logo

Not too fast on amd64

Not too fast on amd64

Posted Feb 12, 2006 2:54 UTC (Sun) by man_ls (subscriber, #15091)
In reply to: pre-compiled, fast code by man_ls
Parent article: A look at GCJ 4.1

I did not keep the code around, so I rewrote it -- now with a much simpler structure -- and run it on my amd64 (some call it x86-64) running OpenSUSE 10.0. The machine had sporadic loads; but the results are quite similar over several rounds, and quite definite too.

I will post the code for review if anyone is interested. Sun's JDK 1.5 revision 6 for amd64, and gcj 4.0.2 20050901 with optimization -O2 were used. The results are:

results for null benchmark
java        gcj
0.007       1.638

results for add int benchmark
java        gcj
1.298       1.118

results for add long benchmark
java        gcj
0.751       1.810

results for add float benchmark
java        gcj
3.054       2.399

results for add double benchmark
java        gcj
3.103       2.223

results for method call benchmark
java        gcj
0.069       4.398

results for create object benchmark
java        gcj
27.28       148.356

results for append string benchmark, 1/5000
java        gcj
0.069       0.183
As you can see Sun has improved some things, notably method calls; while object creation has horrible performance in both Sun's java and GCJ. (The null benchmark was an artifact of the previous test setup, so you can ignore it; probably string concatenation too.) GCJ keeps a slight edge in some arithmetic operations.

I'm looking forward to try out GCJ 4.1.


(Log in to post comments)

Benchmarks...

Posted Feb 16, 2006 9:17 UTC (Thu) by mjw (subscriber, #16740) [Link]

There were recently some benchmark tests done. Some claim gcj produced code is native-complied GCJ modules are almost always about 30-40% faster than other implementations (at least on real world code). Others have micro-benchmarks that show that there are cases where gcj isn't as fast at all. But in the end you have to be careful about what you benchmark, or GCJ will just optimize away all non-used code :)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.