Re:“Clean” Code, Horrible Performance
by 10000truths on Tuesday February 28, 2023 @04:17AM
(#34967317)
A compiler can only devirtualize a virtual call if it knows the underlying object’s type at compile time, which it certainly won’t for a runtime populated array of base class pointers.
CSE doesn’t work across function boundaries unless those functions are inlined, which won’t happen with virtual functions due to the above.
CSE doesn’t work across function boundaries unless those functions are inlined, which won’t happen with virtual functions due to the above.