C++ question here. I have a system where I\'m going to have hundreds of mini-subclasses of a given superclass. They all will have a \"foo\" method that does something. Or
Vtable should be faster in nearly all cases, but if performance is so critical, the right thing to ask is by how much.
Vtable call is triple indirection (three memory accesses to get the target CALL address). Cache misses should not be an issue if there're many calls. So, it is roughly 2-3 switch label comparisons (though the latter offer even less chance for CPU cache miss, but less for pipe usage).
You should of course not rely on anything I said here, and test it all with true performance measurements on your target architecture.