Is pre-linking worth it?
Is pre-linking worth it?
Posted Jul 18, 2009 11:08 UTC (Sat) by magnus (subscriber, #34778)Parent article: Is pre-linking worth it?
In the C++ case, the compiler both generates the vtable structure itself and it knows details of the machine the code will run on, so one would think with a good ABI and compiler the C++ code should always be faster than the C implementation.
The only advantage of C implementations like GObject I can think of, is that the order in the vtable (class structure) is hard-coded in header files, and new functions are added to the end of the structure to maintain backward compatibility. C++ can not do the same trick, because the compiler doesn't know which virtual methods existed in earlier versions of the library. This lack of information makes the C++ run-time relocation problem more complex.
