PDA

View Full Version : Suggestions to speed-up the startup of GUI app



nikhilqt
15th February 2011, 06:44
Hi,

The application what we are working contains some 5 to 6 user-defined plugins. Each plugin is little memory intensive and as a result to initialize and to load the plugins and start the application takes around a minute with system config as below,

RAM: 2 GB
Processor: Intel core 2 Duo 2.4 GHz

Please let me know if you have suggestions or good practice to keep in mind to minimize the application startup time? :)

SixDegrees
15th February 2011, 07:36
It depends what you mean by "startup time". Memory initialization, for example, it typically done by a low-level operating system routine that is beyond your ability to control. So in some cases you're stuck unless you upgrade your hardware/OS.

If you want to give the appearance of responsiveness during initialization, just to let the user know that some sort of progress is being made, toss up a splash screen and/or a progress bar. These will appear very quickly and let the user know that the program launched OK. Users are happiest when they can see something happening.

Or, you can reexamine your initialization routines and see if they are really required or can be performed more quickly. For example, memory allocation is often faster than memory initialization; if you just need a hunk of memory that'll be filled in later, don't bother setting it all to some value.

Other than that, you'd have to post your code to see if there are areas that might be improved.

nikhilqt
15th February 2011, 12:27
Hi,

Application start-up is when mainwindow gets shown to the user. Yes. Right now i am publishing the splash screen till application gets launched. And I am following the standard guidelines of Qt plugins for initialization and loading. As I mentioned in the earlier posts most of the users use the system of that configuration. I will look into the code and try to see whether the start-up time can be reduced. Thanks for your input.

Please let me know if you have any ideas to speeden up such that it will be very helpful.

Thanks,
Nikhil

d_stranz
15th February 2011, 16:33
Do all of the plug-ins need to be loaded at startup time? Can you delay loading a plug-in until it is actually needed? Alternatively, what if you installed a QTimer and had the timeout slot load a new plugin each time it fired? The main window could appear quickly, then over the next few seconds all of the plug-ins could be loaded. Typically, the user isn't going to be doing anything during those first 5 seconds anyway.

nightghost
16th February 2011, 10:23
Maybe the plugins itself are the problem? You should first detect the real cause whats slowing down you and optimize then.

drave
16th February 2011, 16:46
Have a very basic do nothing mainwindow constructure which fires off a one shot timer and do more initialising in that slot.
If that takes a long time have some sort of state machine either working on timers or on events as stages of the startup complete.
For very long startup use threads

regards