This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Speed impact of virtual inheritance
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Frans Englich <frans dot englich at telia dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 10 Oct 2005 17:12:21 +0100
- Subject: Re: Speed impact of virtual inheritance
- References: <200510101521.04036.frans.englich@telia.com>
Frans Englich wrote:
> In a large project I'm participating in, a design dilemma have arrived. Adding
> virtual inheritance would solve it beautifully on the source code level, but
> a potential drawback is the speed penalty it brings. Measurement is always
> the way of approaching performance questions, but since that sometimes can be
> tricky, I thought of starting with getting a theoretical understanding of
> virtual inheritance.
If you don't mean "virtual inheritance as implemented by GCC" then this
is probably the wrong place for such a question.
For an understanding of how it's implemented try "Inside the C++ Object
Model" by Stan Lippmann, and this draft report (especially section 5.3.6)
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1666.pdf
That's by a well-respected member of the standard committee, so you can
take it pretty seriously. I'd certainly give it more credence than
unsubstantiated claims thrown up by googling.
Regards,
jon