Java vs C++ performance test