In this case, there is no difference in performance.
Since StartEngine is not virtual, the compiler, and then the jitter, knows exactly what is meant by calling it, whether in the database, in the derived class, or outside the class.
If StartEngine was virtual, and the compiler and / or jitter could deduce that you are calling against CityBus and not something received from CityBus, then what (very small) difference is there can also be removed as optimization.
If StartEngine was virtual, and the compiler and / or jitter could not determine whether you are calling the CityBus against the derived class, then the distinction between a base or direct call is vital for correctness.
As a rule, the only place where you can call the base method with base. , is in the redefinition of this method to make it more understandable. If the distinction between a base and a derived version is important elsewhere, you should try reorganizing so that base.SomeVirtualMethod() base.SomeNonVirtual() in base.SomeNonVirtual() , which is therefore always available, even if derived.SomeVirtualMethod() changes the behavior.
Jon hanna
source share