Comparative performance of C(gcc) and C++(g++)

John Love-Jensen
Thu Jan 30 15:05:00 GMT 2003

Hi Mihnea,

>Making and using interfaces through the use of virtual functions forces the
compiler to generate extra code that looks up the method's address in the
object's virtual table before actually calling the method. This can lead to
performance issues.

C++ often leads to performance improvements, because the common C way to do
something similar is through a switch statement on a tag value, which is
LESS efficient than the C++ virtual table lookup mechanism.


More information about the Gcc-help mailing list