GCC and Fortran eat GCJ for lunch at number crunching
Jeff Sturm
jsturm@one-point.com
Thu Jan 2 19:01:00 GMT 2003
On Thu, 2 Jan 2003, Erik Poupaert wrote:
> Is there any fundamental reason for gcj to be slower than equivalent
> (garbage-collected) C++?
Probably, but not often 3x slower.
The benchmark author used multidiensional arrays extensively in his C++
and Java code. Statements like
da = a[np][0] + (a[np][1] + a[np][2] * t ) * t;
work very differently in the two languages. (Although CSE should prevent
evaluting a[np] thrice, the array elements do not lie in contiguous
memory, affecting spatial locality).
I've also noticed GCC's register allocator struggles with large, complex
routines like in almabench.java. Re-running the benchmark with -fnew-ra
on my PIII is good for about a %20 speedup.
Jeff
More information about the Java
mailing list