News for hackers. Stuff that matters.
Re:Why Python Is Slow: Looking Under the Hood by plikan13 on Tuesday November 18, 2014 @06:28PM (#8627084)
Why can't a C++ compiler optimize away virtual function tables? If a C++ compiler could deduce the exact derived type of all objects at compile time, it could call the correct virtual function statically instead of going through the extra indirection at runtime.
Re:Why Python Is Slow: Looking Under the Hood by zanny on Tuesday November 18, 2014 @07:36PM (#8627429)
If you declare a C++ virtual function final the compiler can avoid the virtual call table for any invocations of that function in the future on that object or any of its derivatives. Of course, you then cannot override it in child classes anymore.

If you declare a virtual function inline, if it is invoked from a well defined object (ie, not through a reference or pointer) you also get a similar effect while still being able to override, except the code is not a static call but is just inlined with that one implementation of the function.

Re:Why Python Is Slow: Looking Under the Hood by pjmlp on Wednesday November 19, 2014 @01:56AM (#8628634)
It can, but not across dynamic libraries.

You just need to use profile guided optimisation.