[Qt-interest] tips for optimising cold-start Qt application startup time on Windows (and OSX)?

Malyushytsky, Alex alex at wai.com
Tue Apr 6 02:28:13 CEST 2010


I would expect to see  the difference between static linked vs dll loaded only, if application is not using significant amount of the code present in the HUGE dll or there were  a lot of small dlls loaded.
In the second case you might want to write your own loader like google did :P

But I don’t think either cases can be applied to 2 mentioned dlls. So I would not expect any significant improvements when static linking is used , especially cause it is not really static (on Windows) and your application still will have to load msvcrt dlls.

According to my experience the major time of application loading time usually is spend on reading QSettings  from registry (to restore states, ets), resource initialization ( for example  icons read from files  ) and not on [Qt or any other ]  dll loading.

My application, which loads like 50 dlls (vtk, Qt, etc)takes less than 2 sec to load (cold start) on desktop.
On other devices it might be slower, but first of all I would try to find other potential bottlenecks before trying to improve dll loading time.

One of the advice might be to use cashing for settings usually written to registry (if you use QSettings you mostly likely write to the registry on Windows. And if such information is large enough it may give you a significant delay).
Read it from registry only if there is no  cash file or if it is corrupted. And write such file every time application is properly closed.

Just my 5 cents :P

Alex



From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Tiago Correia
Sent: Monday, April 05, 2010 4:21 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] tips for optimising cold-start Qt application startup time on Windows (and OSX)?

Hi

What about link your program statically? =>
- your program will start up faster and user less memory IF YOUR program is
the ONLY prog using these Qt libs
- the overall amount of code to deploy with your program maybe smaller because
the linker can omit unused parts of the libs
- deploying is simpler

In our company we do use static link and some of the applications also have the same problem starting in Windows. We don't see any difference in loading from a static or linked version of the same application.

--
Tiago Correia


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100405/792b54f6/attachment.html 


More information about the Qt-interest-old mailing list