News for hackers. Stuff that matters.
Re:The cost of dynamic vs. static dispatch in C++ by berkut on Thursday December 05, 2013 @11:29AM (#6855214)
I've done benchmarks on this fairly recently, and with the functions actually doing a lot of work (ray intersection for a raytracer), I saw practically no difference between CRTP and Virtual Functions:

http://imagine-rt.blogspot.co.uk/2013/08/c-virtual-function-...

And this was with billions of calls to the functions...

Re:The cost of dynamic vs. static dispatch in C++ by blt on Thursday December 05, 2013 @11:52AM (#6855402)
Yes, the penalty is most glaring for calls that do a tiny amount of work. Imagine if

  String.charAt(int index)
was a virtual call inside of strlen().