I don't know why, but I got a good laugh from that statement. Those "kids" are all the same age or older than Java; PHP, Ruby, and Java were introduced within a few months of each other in 95 and Python dates back to 91.
I hate to be that guy but 1) java does not go neck to neck with c++ unless you mean it can be in the same order of magnitude and 2) C++ is not slower than C or Go or Rust
Note: by c++ I mean c++ compiled by a decent compiler e.g. gcc/clang/msvc
In Java you will have to deal with an array with a million pointers to a million objects and in C++ you will deal with a sequential segment of memory that is a million times the size of your object - and mostly in your CPUs cache. That alone will be much, much faster.
But you can't do that in Java at all.
When you want, for example, an array of (float x, float y) “objects” in Java, you just keep them as two arrays (float[] x, float[] y) — and I guarantee it will use the same amount of memory and will have nearly the same speed as C++ (depends on what cache locality you need for a specific task, it might even be faster to have two separate arrays for some tasks).
So yeah, depending on the language, a slightly different implementation is more efficient, so one has to know its tools.
Also, as far as I know, when project Valhalla extension goes live, you will have an option to do packed structs the same way as C++ or C# does.
Edit: Oops, there was another reply about the same in the thread. I should remember to refresh the threads before answering in the morning.
And if you are doing something like nearest cluster mapping, or anything else where you process your data in linear order you are not going to get the optimized cache locality. Plus you can't read the file with mmap if your data is from there.
I would go further and say that if your job is analyzing terabytes of memory-mapped binary files, maybe C++ is not optimal either, and investing in specialized languages like Shakti/K would pay off quickly.
I would seriously contest the speed of Java compared to modern PHP. The JIT puts PHP at near-C performance levels with competently written code. Which shouldn't be surprising if you realize PHP is largely a "wrapper" around C.
Vertx framework which is based on Java is at 8th position and PHP is 18th.
But the larger point is performance is only one aspect while considering which programming lang. or framework to use
From the page above The bottomline: PHP 8 is still slower than PHP 7.
This is a realistic comparison of running Magento on php7 vs php8.
yet every time I try a Jetbrains IDE every action seems to take 10x the time to be processed than it takes in QtCreator