[Qt-interest] Making a Qt program into a dynamic library

Allan Sandfeld Jensen sandfeld at kde.org
Thu Dec 17 15:28:50 CET 2009


On Wednesday 16 December 2009, Oliver.Knoll at comit.ch wrote:
> Why would this speed up an application? I would expect that this would take
>  even longer (compared to a single huge executable which is loaded at once
>  into memory), since dynamic linkage also takes its time. Or do you mean
>  "Code is only dynamically loaded/linked when actually needed?"
> 
No, it loaded the entire executable binary as a dynamic libary. C++ linking 
was very expensive in earlier binutils, and before hidden symbols support from 
gcc and Qt. Being loading from an application that already was linked to most 
libraries you used, meant only your own symbols needed to be linked instead of 
all symbols in all the libraries you used. This reduced startup time for KDE 
applications from 10 seconds to around 1 second.

Even today this trick is still marginally faster, but it is not a killer like 
it used to be.

I am not sure, but I think there was also a platform or two that didn't 
support shared-libraries very well, and this trick meant the applications 
could share the same loaded copy of the library even when the platform didn't 
normally support it.

`Allan



More information about the Qt-interest-old mailing list