This is quite cool. Andy Johnson, a colleague of mine on the Java performance team, did a few performance tests comparing Java to native C.
SciMark2 was used for the performance comparision. The system under test was a 2Ghz Pentium white box running Windows 2000 and using the Microsoft Visual C/C++ 6. The C code was compiled with full optimization. The server compiler was used for both J2SE 5.0_07 and Java SE 6.
Scimark2 is a set of simple numerical kernels and its performance is directly related to the performance and quality of the generated code. The tests are single threaded and have little to no garbage collection overhead. In short, a great set of applications to compare statically compiled C code and dynamically compiled Java.
The chart below is quite revealing. Both the charts are normalized to J2SE 5.0_07. Native C is only 3% faster than 5.0_07 and Java SE 6 pulls ahead of native C by 2%.

The following chart breaks the comparison down further. Remember SciMark2 is a composite benchmark and the overall score is a simple mean of each subtest mflops score. With that, Java is ahead in some cases, and behind in others. Actually Java is ahead in all cases except Sparse Matmult. Looks like we have something to look at for additional optimization.
Posted by Edson Watanabe on June 09, 2006 at 01:02 PM EDT #
Posted by Michael van der Westhuizen on June 09, 2006 at 01:36 PM EDT #
Posted by Surya on June 09, 2006 at 03:03 PM EDT #
My guess (long ago) was that Java performance with JIT would equal or beat C performance on heavy floating point (and GUI code - another topic) before anything else.
I would guess the SciMark2 code is not typical of either Java or C applications. :)
Posted by Preston L. Bannister on June 09, 2006 at 03:16 PM EDT #
Posted by 66.222.49.3 on June 09, 2006 at 03:54 PM EDT #
Posted by dagastine on June 09, 2006 at 04:44 PM EDT #
Posted by Pete Kirkham on June 11, 2006 at 01:21 PM EDT #