celeritas
celeritas copied to clipboard
Reexamine use of virtual inheritance
Virtual+multiple inheritance certainly works as a design pattern but it has some pretty large overhead both in code and object size. Even empty classes (default destructors, no data) require extra construction vtables. Adding mutable/base interfaces for the action classes increases action class setup/teardown/vtable/typeinfo code size about 30% in the simplest case, most of it in initialization. Eliminating virtual inheritance reduces the code size by another 40% after that.
We need to at least make sure that we only use virtual inheritance with hierarchies as shallow as possible, for as few as possible classes, and only using those at a high level.