What are the performance implications of inheriting a class vs including a ptr to an instance of the class as a member variable?
<p>I am working in a class "A" that requires very high performance and am trying to work out the implications either way.</p>

<p>If I inherit this new class "B", the memory profile of "A" should increase by that much.  </p>

<p>If I include just a ptr to "B" as a member variable in "A", then would I be correct in thinking that, as long as "B" is on the heap (ie new'd up) then "A" will remain as small as it is other than the new ptr reference.  Is there something else that I haven't thought of?</p>

<p>It is preferable architecture wise for me to inherit "B", however it may be preferable performance wise to just stick with it as a member variable.</p>
