|C++ vs C compiler on size firstname.lastname@example.org (1997-01-07)|
|Re: C++ vs C compiler on size email@example.com (Arch Robison) (1997-01-09)|
|Re: C++ vs C compiler on size firstname.lastname@example.org.OZ.AU (1997-01-12)|
|Re: C++ vs C compiler on size email@example.com (1997-01-12)|
|Re: C++ vs C compiler on size firstname.lastname@example.org (1997-01-12)|
|Re: C++ vs C compiler on size email@example.com (Stanley Chow) (1997-01-14)|
|Re: C++ vs C compiler on size firstname.lastname@example.org (Joseph Donahue) (1997-01-14)|
|Re: C++ vs C compiler on size email@example.com (1997-01-16)|
|Re: C++ vs C compiler on size firstname.lastname@example.org (Kurt Svensson) (1997-01-16)|
|From:||"Stanley Chow" <email@example.com>|
|Date:||14 Jan 1997 20:07:27 -0500|
|Organization:||Bell-Northern Research Ltd.|
|Keywords:||C, C++, code|
firstname.lastname@example.org (Zhenghao Yeh) writes:
>> How much overhead we have to pay if we need:
>> 1. inheritance?
>> 2. virtual functions?
>> 3. template?
Bill Leonard <Bill.Leonard@hawk.hcsc.com> wrote:
>I don't think anyone can answer that definitively -- it depends too
>much on the compiler, the machine architecture, and exactly how those
>features are being used.
True. It happens that I hacked together a test to compare the
speed of virtual functions vs C equivalent. On the platform/compiler
combinations that I tried, virtual functions came in average 10%
>If you are comparing C++ to C, then you should compare two equivalent
>things. For instance, compare a virtual function call to the
>*equivalent* C code that would implement the same functionality.
In my case, I tried to compare apples to apples and the simplest
virtual function usage is slower than the most general ptr-to-function
Stanley Chow; email@example.com, firstname.lastname@example.org; (613) 763-2831
Bell Northern Research Ltd., PO Box 3511 Station C, Ottawa, Ontario
Return to the
Search the comp.compilers archives again.