c vs. java vs. gcj performance
Andrew Haley
aph@redhat.com
Thu May 22 13:42:00 GMT 2003
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.
More information about the Java
mailing list