Java was initially slow before the JIT but today performance is pretty close to C++. I want to know if someone has done measurable performance comparisons between the two langu
To complete Pax's and Uri's answer, here are some recent benchmarks:
As said, those are two very different languages, and some are convinced that Java will ever be slower than C++ because of:
[Humor]
"Java is high performance. By high performance we mean adequate. By adequate we mean slow." Mr. Bunny
As mentioned by dribeas in the comments, Heap allocation is not a good argument.
This "Urban performance legends, revisited" mentions:
"Garbage collection will never be as efficient as direct memory management." And, in a way, those statements are right -- dynamic memory management is not as fast -- it's often considerably faster.
The malloc/free approach deals with blocks of memory one at a time, whereas the garbage collection approach tends to deal with memory management in large batches, yielding more opportunities for optimization (at the cost of some loss in predictability).