This may depend on what you are doing in C ++ code.
For example, do you use a GPU? Edit I forgot about jogl, so Java can compete here.
Whether you are parallelized using STM or shared-memory, then Java cannot compete. For a link to the analysis of parallel matrix multiplication: http://www.cs.utexas.edu/users/plapack/papers/ipps98/ipps98.html
You have enough memory to perform in-memory calculations, so you don’t need the garbage collector, and you fine-tuned the garbage collector for optimal performance? Then maybe Java can be competitive.
Do you use multi-core processors and is C ++ optimized to use this architecture? Then Java will not be able to compete.
If you use several computers connected to each other, then Java will not be able to compete.
Do you use any combination of them, then it will depend on the specific implementation.
Java is not designed to compete with a manually configured C ++ program, but the time it takes to configure is that you do enough computation where it matters? Java will be able to give some reasonable speed, but with less work than manual tuning, but not much of an improvement than just C ++ code.
You might want to see if there are improvements over Haskell or Erlang, for example, over your C ++, as these languages are better designed for this type of work.
James black
source share