Performance improvement while integrating static libraries vs dynamic libraries
-
I have project in which I have statically compiled memory manager and have dynamically linked QT libraries . the suggestion is is to enable static linking of all QT code into executable, thus facilitating statically compiled memory manager used static linking of all QT code as this will lead to performance improvement in runtime
Can some one tell me what is reason the when statically compiled memory manager uses static linking of all QT code then it will lead to runtime improvment
-
@Qt-Enthusiast I really doubt there is a big difference in runtime performance between static and dynamic linking. The startup time of a statically linked application can be shorter, but after startup there will be no difference.
I don't know what this "statically compiled" memory manager is and how it is related to Qt. -
Hi
The reason to use static or dynamic loading has nothing to do with performance.Its to allow code reuse/modules or to make deployment easier. ( single exe)
As @jsulm says, once the lib has been loaded and resolved, then
the execution speed is the same.if you have tons and tons of libs. then if u use dynamic loading (on demand) it could be faster
to load that fat static linked.
But since we talk in MBs here,
the actual difference will be very small in miliseconds.