LWN: Comments on "A look at GCJ 4.1"
http://lwn.net/Articles/171139/
This is a special feed containing comments posted
to the individual LWN article titled "A look at GCJ 4.1".
hourly2A look at GCJ 4.1
http://lwn.net/Articles/172377/rss
2006-02-16T21:22:06+00:00anton
<font class="QuotedText">>>While Java is a slightly odd language for some things, its</font><br>
<font class="QuotedText">>>possibility to run everywhere using bytecode was ahead of its time.</font><br>
><br>
<font class="QuotedText">>What happened to p-Code?</font><br>
<p>
Way ahead of its time:-).<br>
Benchmarks...
http://lwn.net/Articles/172243/rss
2006-02-16T09:17:34+00:00mjw
There were recently some benchmark tests done. Some claim gcj produced code is <a href="http://gcc.gnu.org/ml/java/2006-02/msg00092.html">native-complied GCJ modules are almost always about 30-40% faster</a> than other implementations (at least on real world code). Others have <a href="http://gcc.gnu.org/ml/java/2006-02/msg00127.html">micro-benchmarks</a> 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 <a href="http://gcc.gnu.org/ml/java/2006-02/msg00137.html">GCJ will just optimize away all non-used code</a> :)
Not too fast on amd64
http://lwn.net/Articles/171655/rss
2006-02-12T02:54:14+00:00man_ls
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.
<p>
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 <code>-O2</code> were used. The results are:
<pre>
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
</pre>
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.
<p>
I'm looking forward to try out GCJ 4.1.
A look at GCJ 4.1
http://lwn.net/Articles/171528/rss
2006-02-10T18:43:55+00:00jzbiciak
<BLOCKQUOTE><I>While Java is a slightly odd language for some things, its possibility to run everywhere using bytecode was ahead of its time.</I></BLOCKQUOTE>
What happened to <A HREF="http://en.wikipedia.org/wiki/P-Code_machine">p-Code</A>?
pre-compiled, fast code
http://lwn.net/Articles/171484/rss
2006-02-10T13:52:43+00:00man_ls
I also did some benchmarks some time ago (may 2004). The results are <a href="http://libertonia.escomposlinux.org/story/2004/5/9/202121/4363" >here (in Spanish, the site is under maintenance right now)</a>; I will quote some of them here. Code was inserted in a loop and repeated 10^9 times, except the last loop which had 2*10^5 iterations.
<pre>
results for null benchmark
java gcj
0.812 1.527
results for add int benchmark
java gcj
2.66 0.082
results for add float benchmark
java gcj
3.703 0.981
results for add double benchmark
java gcj
2.649 0.985
results for method call benchmark
java gcj
2.818 0.081
results for create object benchmark
java gcj
3.081 10.02
results for append string benchmark, 1/5000
java gcj
4.003 9.583
</pre>
As you can see, arithmetic computations and method calls were much faster in gcj; object creation was slower. It would be interesting to repeat the tests again, with newer versions of both Sun's JVM and GCJ. I will see if I have the code lying around.
A look at GCJ 4.1
http://lwn.net/Articles/171445/rss
2006-02-10T02:59:02+00:00pimlott
<blockquote type=cite>its possibility to run everywhere using bytecode was ahead of its time.</blockquote>
Compiling to machine-independent bytecode is a <a href="http://foldoc.org/?OCODE">very</a>, <a href="http://wiki.cs.uiuc.edu/VisualWorks/Overview+of+different+implementations+of+Smalltalk">very</a>, <a href="http://www.inform-fiction.org/zmachine/interpreters.html">very</a> old idea.
pre-compiled, fast code
http://lwn.net/Articles/171435/rss
2006-02-10T00:49:49+00:00pkolloch
I think that precompiled Java code (using gcj) is often still slower than <br>
byte code on a recent commercial JVM with JIT. That doesn't mean that it <br>
isn't quite fast! <br>
<br>
(_Years_ ago I made some simplistic tests showing that the C++ STL <br>
containers didn't perform significantly better than the Java equivalents <br>
when using a decent amount of initial JVM memory. Both sides have probably <br>
been improved now.) <br>
<br>
What is absolutely wonderful about precompiled, binary Java code is <br>
integration with C, C++, ...! And then using gdb to debug it all! <br>
Run everywhere?
http://lwn.net/Articles/171275/rss
2006-02-09T13:26:56+00:00man_ls
<blockquote><cite>
While Java is a slightly odd language for some things, its possibility to run everywhere using bytecode was ahead of its time.
</cite></blockquote>
With Perl you can also run the same file, and <a href="http://www.cpan.org/ports/index.html" >on many more platforms than Java</a>. So it is with any program in Bash, Python, BASIC... and you don't have to go through the motion of a pre-compilation which serves no practical purpose other than a very primitive obfuscation.
<p>
What I find really interesting in gcj is the ability to compile Java into a useful and fast binary for your platform.
A look at GCJ 4.1
http://lwn.net/Articles/171270/rss
2006-02-09T10:57:30+00:00kleptog
Thanks for the update it's really quite interesting. One thing that strikes me is the Java might finally be able to take the position it could have had years ago. While Java is a slightly odd language for some things, its possibility to run everywhere using bytecode was ahead of its time.<br>
<p>
But it has always been hampered by restrictive licencing and initially speed. I remember at Uni we used the IBM Java compiler because the standard one was sloooow. It was cool to be able to test and run your assignments at home and then upload them unchanged to the Uni (different platform, different OS).<br>
<p>
It's also nice to have Java installed via your distribution so you can run Java programs without having to mess with third party installers...<br>