c++ virtual function vs member function pointer (performance comparison)
问题 Virtual function calls can be slow due to virtual calls requiring an extra indexed deference to the v-table, which can result in a data cache miss as well as an instruction cache miss... Not good for performance critical applications. So I have been thinking of a way to overcome this performance issue of virtual functions yet still having some of the same functionality that virtual functions provide. I am confident that this has been done before, but I devised a simple test that allows the