c vs. java vs. gcj performance
Thu May 22 13:23:00 GMT 2003
> > 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.
My bug ... an "extra" return statement was short-circuiting much of the
computation in the c version of my benchmark.
As it now stands, the gcj version is, in fact, somewhat *faster* than the
c version. Good enough for my purposes.
More information about the Java