Why Strings as Classes?

Walter Bright newshound1 at digitalmars.com
Tue Aug 26 02:31:55 PDT 2008


Yigal Chripun wrote:
> a) people here said that a virtual call will make it slow. How much
> slow? how much of an overhead is it on modern hardware considering also
> that this is a place where hardware manufacturers spend time on
> optimizations?

Virtual function calls have been a problem for hardware optimization. 
Direct function calls can be speculatively executed, but not virtual 
ones, because the hardware cannot predict where it will go. This means 
virtual calls can be much slower than direct function calls.



More information about the Digitalmars-d mailing list