This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: c vs. java vs. gcj performance
Miguel writes:
> > > I wrote it in java and c. The c code (compiled with gcc) is 8 times
> > faster than the java code (under Sun jvm 1.4.1_02).
> >
> > Shouldn't be, unless you're doing a lot of object creation.
>
> mea culpa
>
> My bug ... an "extra" return statement was short-circuiting much of the
> computation in the c version of my benchmark.
Ah. :-)
> As it now stands, the gcj version is, in fact, somewhat *faster* than the
> c version. Good enough for my purposes.
Truly fabulous. That benchmark is something I'd *love* to see!
Andrew.