News for hackers. Stuff that matters.
Re:The overhead of abstraction in C/C++ vs. Python/Ruby by haberman on Saturday October 18, 2014 @06:30PM (#8476550)
I had this benchmark that used to show a 10% difference between non-inlined and virtual: https://gist.github.com/haberman/5621682

But since I wrote that, compilers have gotten too smart. When I tried it just now, the compiler devirtualized the function call (which I verified by reading the assembly language output).

I should mention though, the the inability to inline virtual functions is part of what makes them less efficient in some cases. Isolating the inlining factor removes one of the benefits that makes non-virtual functions perform better.

There are no comments on this comment yet.