Virtual functions have many advantages, but here are a couple of their disadvantages:
- slower -- The function call takes slightly longer due to the virtual mechanism,and it also makes it more difficult for the compiler to optimize because it doesn't know exactly which function is going to be called at compile time.
- harder to debug -- In a complex system, virtual functions can make it a little more difficult to figure out where a function is being called from. Or, to figure out why a function isn't being called if someone overrode it with a new virtual function.