For big loops, be comforted in knowing that message passing is aggressively cached; the second and subsequent calls are barely slower than a C method call.
And for those insanely big loops, with methodForSelector: you can bypass message passing entirely and call the method directly... you speed freak.
Adding to that, the things a C++ compiler can do at compile time (via static typing and full knowledge of the types) is pretty convenient and impressive, relying on these things to be done at run-time is often complex and/or require more code to be written by the programmer.
If you can live with enabled exception handling (which is a performance toll) then some additional object meta data shouldn't be a problem.
The thing is, C++ is usually good about not charging you for features you don't use - and with the reasonably good debugging and profiling tools, most of the problems you mention above are fixable to get performance that is close (or equal) to C, with maybe better maintainability.
To pick a not-so-random example of something that's difficult to implement in C as safely as in C++, see expression templates[1]. I'd be interested in something similar to what eigen does written in C. (Of course, the last time I did this minibenchmark, so-and-so's lapack library was still slightly faster than eigen :)
The bottom-line, perhaps, is that if I'm writing a library, I'd do it in C simply because it's self-contained and has a nicely limited scope, and as a bonus is usable from oh-so-many other languages. If I'm writing an application that really, really requires serious performance, I'd prefer to use C++.
Can you guarantee that for every 3rd party lib you use?
Since C++ lets you omit language features until you basically have plain C, you get to choose what level of support you can live with.
For example to get a class name you can either use [object className]. Or you can use object_getClassName()/directly access "anObject->class_pointer->name" without dispatching any messages. The same goes for any other runtime attribute of an object.
On the other hand, you cannot determine if reflection will be used (not, at least without solving the halting problem) and so you have to generate the reflection code for everything.
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"
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)
It's a bit more subtle than that: a virtual destructor is only required when the class, or its base classes, already have another virtual function (and it's only really needed if another class inherits from it. hmm.) At that point, a virtual destructor doesn't add any more cost over and above the virtual function that's already defined.
This would've been prevented if destructors were always virtual.
My take is that if the compiler cannot make the decision, but it's left to you, in this case it's better to always have the virtual destructors ON.
The problem is more visual than analytical - you would have to dig through the whole hierarchy in several files to understand whether you need to put a virtual destructor or not. Compiler/Linker/some post-proc tool should be better at that job. It already has all that information.
Actually I did not know about this option. I've just fixed such bug in one of our tools, written using wxWidgets for Windows. Have to check MSVC on this option.
At the same time a coworker was able to get the Xbox360 analyze thing and it worked finding suspicious stuff in the runtime code.
But we have only the professional version for PC :(
Your derived class only needs a virtual destructor if the base class's destructor is public. If the base class destructor is protected (or private), then no one can call delete on a pointer to a base class.
This can be a quite rare situation, though. But not impossible.
The main advantage (and probably the unique) C++ has over other system languages like Objective C is the "near to C" performance and it does it maintaining the runtime at the minimum doing all his thing at compiling time. reflection/instrospection requires a more complex and slowly runtime.