by Dwedit · 2y ago · 0 comments
But the real penalty for using Virtual Calls is the potential loss of inlining. It depends on how smart your compiler is.
E.g. if you're making a graphics display driver, don't have objref->putpixel(x, y) as your only virtual function, which has to be called thousands of times to draw a line or millions to fill an area.