sincerely I don't know if is comparable the virtual function's overhead with the reflexion's overhead.
Stroustrup answered a question about reflexion in this interview[1]:
Have you ever considered adding reflection to C++?
BS: Often. However, I have not seen an approach to full reflection directly supported by a language that didn't cause serious overheads. Also, reflection seems to encourage styles of programming that make it hard to determine what's going on from the source text and discourage static checking. I see that as a problem. Consequently, the C++ RTTI provides only the minimal information to determine the types of objects at run time. Where necessary, this can be used as a handle for more information about types (classes), but any such information is beyond what the standard guarantees[2].
MSVC Runtime already keeps names of the classes in the executable (browse the EXE and you would see it).
Really the only loss there would be memory usage. And this can be all optional - where you can waste some memory, for more information about the code currently running - the better.
There's already been such scarifies in C++ - exceptions, RTTI cannot be used everywhere - a xbox console would not handle C++ exceptions for example, yet you can still write in C++ (someone might argue that it's not C++ if it does not have exceptions)
Stroustrup answered a question about reflexion in this interview[1]:
Have you ever considered adding reflection to C++?
BS: Often. However, I have not seen an approach to full reflection directly supported by a language that didn't cause serious overheads. Also, reflection seems to encourage styles of programming that make it hard to determine what's going on from the source text and discourage static checking. I see that as a problem. Consequently, the C++ RTTI provides only the minimal information to determine the types of objects at run time. Where necessary, this can be used as a handle for more information about types (classes), but any such information is beyond what the standard guarantees[2].
[1] http://www2.research.att.com/~bs/omo_interview.html
[2] I think he was talking about "type_info"