Alex Rivera | Logout

C/C++ versus Java/C# in high-performance applications

Asked 2010-02-27T21:02:01.197
11

My Question is regarding the performance of Java versus compiled code, for example, C++/fortran/assembly in high-performance numerical applications. I know this is a contentious topic, but I am looking for specific answers/examples. Also community wiki. I have asked similar questions before, but I think I put it broadly and did not get answers I was looking for.

double precision matrix-matrix multiplication, commonly known as dgemm in blas library, is able to achieve nearly 100 percent peak CPU performance (in terms of floating operations per second).
There are several factors which allow achieving that performance:

  • cache blocking, to achieve maximum memory locality

  • loop unrolling to minimize control overhead

  • vector instructions, such as SSE

  • memory prefetching

  • guarantee no memory aliasing

I have have seen lots of benchmarks using assembly, C++, Fortran, Atlas, vendor BLAS (typical cases are a matrix of dimension 512 and above). On the other hand, I have heard that the principle byte compiled languages/implementations such as Java can be fast or nearly as fast as machine compiled languages. However, I have not seen definite benchmarks showing that it is so. On the contrary, it seems (from my own research) byte compiled languages are much slower.

Do you have good matrix-matrix multiplication benchmarks for Java/C #? does just-in-time compiler (actual implementation, not hypothetical) able to produce instructions which satisfy points I have listed?

Thanks

with regards to performance: every CPU has peak performance, depending on the number of instructions processor can execute per second. For example, modern 2 GHz Intel CPU can achieve 8 billion double precision add/multiply a second, resulting in 8 gflops peak performance. Matrix-matrix multiply is one of the algorithms which is able to achieve nearly full performance with reg

Edit
Report

1 Answer

0
answered 2010-02-27T21:14:21.513

Your Answer