&gt; better than typical C++ because you avoid virtually all object allocation&#x2F;deallocation costs that C++ has<p>So to have Java perform better than C++ you just have to avoid allocation in Java and leave it in in C++?<p>&gt; If you want better I would not bother with C++ at all personally, but use C &#x2F; assembly or even look at FPGA type setups.<p>There is nothing in C that gives it a speed advantage over C++. Basically you&#x27;ve discovered step 1 of 3 when optimizing software (step 0 is to profile) -<p>1. Minimize heap allocations
2. Rework memory access for cache locality
3. Use SIMD<p>1 and 2 can be done with C++. 3 really needs to be done with something like ISPC so that SIMD use isn&#x27;t fragile and compiler dependent.