> C++ has many language features that allow compilers to generate efficient code.
It does, but it also has the ability of generating inefficient code. Sure, it's often the developers fault but I feel like it's much easier to shoot yourself in the foot in terms of performance in C++ compared to other compiled languages.
Some real-life examples for me:
* Missing a '&' for a function parameter resulting in that object being copied for each function invocation
* Adding a couple extra chars to an error message string in an inlined function which caused that function to then be 'too large' to inline according to the compiler
It does, but it also has the ability of generating inefficient code. Sure, it's often the developers fault but I feel like it's much easier to shoot yourself in the foot in terms of performance in C++ compared to other compiled languages.
Some real-life examples for me:
* Missing a '&' for a function parameter resulting in that object being copied for each function invocation
* Adding a couple extra chars to an error message string in an inlined function which caused that function to then be 'too large' to inline according to the compiler