4 ms·
There is no such thing as a C / C++ compiler implementation. There are C implementations, and C++ implementations that may share some components. They do not ty
by ncmncm 7y ago
There is no such thing as a C / C++ compiler implementation. There are C implementations, and C++ implementations that may share some components. They do not typically share optimizers, because optimization of C++ requires quite different characteristics of an optimizer than one for C -- although most of the C optimizations may be applied after the C++ ones have run.
If it is hard to see how C++ optimization would differ from C optimization, you simply aren't looking very hard.
There are many different toolchains, but with the toolchains that are commonly used, C++ programs are faster than C programs. More specifically: C++ programs are at least as fast as C programs, because a C program is a badly-coded C++ program that fails to use language constructs that would make it a better program.