|
|
Log in / Subscribe / Register

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?

Why is long start-up times due to symbol relocation mainly an issue with C++ libraries when C libraries like the GTK stack also have object-oriented functionality with vtables etc implemented in software?

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.


to post comments

Is pre-linking worth it?

Posted Jul 23, 2009 7:35 UTC (Thu) by renox (guest, #23785) [Link]

>Why is long start-up times due to symbol relocation mainly an issue with C++ libraries when C libraries like the GTK stack also have object-oriented functionality with vtables etc implemented in software?

Probably because C++ ABI isn't good..


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds