Comment: Re:Java at least as fast as C++ (Score 1) 405
However, modifying the C++ version to utilize custom new and delete operators for the necessary classes to cater to the specific demands of such an application once again pushes the C++ version's performance ahead of Java, as expected.
I'm aware of such tests - but all they confirm is that pre-allocating a chunk of memory and re-using it is faster than individual allocate/deallocates.
That's not really that surprising. vector and other containers in C++ provide methods for storage (pre)allocation that can perform similarly.
If anything, it indicates that the program code is probably less than stellar C++ (stack allocations won't cost you anything and your destructors should be empty for value types).
Modern C++ shys away from OO derivations, too, where you should be using templates to get your abstraction for (almost) no runtime cost. Don't use virtual function calls - they're expensive - derive from a template class or use functors and get an inlined call for (almost - one byte) free.
Now don't forget Java has other things working against it (class recompilation, profiling, JVM stalls due to housekeeping etc).
A native compiled C++ program won't stall or halt your running threads. It's predictable.
Now we can argue about the effort to write decent Java and decent C++ and there I'll agree Java is a much more approachable language.