That extra indirection often means a cache miss. That isn’t cheap. Accessing each item traversed through a pointer can easily halve program speed.
Java tries hard to prevent the indirections (local objects may live in the stack, their memory layout need not follow what the source code say, objects may even only exist in cpu registers)
:-(
It's also not infallible and you might find it difficult to track a regression if introduced by someone silently breaking a heurestic in the optimiser.
However with VC++ it doesn't seem to be that bad, when incremental compilation and linking are enabled.
[0] https://docs.microsoft.com/en-us/cpp/build/reference/ltcg-li...
That's what happens when I spend most the time on JVM/.NET worlds. :)
There are still more platforms with a C++ compiler available than Ada, Java or C# ones, let alone Go, D, Rust, Swift.
So if the goal is to make the code available to all platforms, without having to deal with C's lack of safety, then C++ it is.