Re:The cost of dynamic vs. static dispatch in C++
by vinkelhake on Thursday December 05, 2013 @10:46AM
(#6854949)
This is a nice article and props for including and dissecting generated assembler!
A key thing here is that inlining is what enables zero-cost abstractions in C++. A virtual call is slower than a regular call, but the main problem is that it builds a barrier that effectively stops inlining.
It'll be interesting to see how devirtualization in GCC will do for real world programs.
A key thing here is that inlining is what enables zero-cost abstractions in C++. A virtual call is slower than a regular call, but the main problem is that it builds a barrier that effectively stops inlining.
It'll be interesting to see how devirtualization in GCC will do for real world programs.