Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt Widgets Application start up very slowly
Lately, I upgraded my SDK from QT4.6.2 to QT5.11.2. Then I find the applications start up very slowly on Win7. Is there any way to improve this?
The application I used to test is very simple. I just dragged several widgets to mainwindow.ui, then compiled.
Performance on qt-opensource-windows-x86-5.11.2, Win7. It takes 4000~6000 ms to show window at the first time after system start up. Then it takes 200~350 ms to show window in the next few runs.
Performance on Qt4.6.2, Win7. It takes 400~600 ms to show window at the first time after system start up. Then it takes 30~50 ms to show window in the next few runs.
Before I double click to start application, I wait one or two minutes to make sure system initialization has been completed.
The time it cost is from Qapplication constructor to mainwindow.show. The most time is cost by mainwindow.show. But also Qapplication and mainwindow constructor cost much more time than Qt4.6.2.
Why does it take so long to display the window for the first time? Is there something I can disable?
@JerryZhu Are you testing release build?
Yes, both are release
My test application looks like this. I removed the layout in the groupBox this time. Then the time cost seems normal now. 47 means it took 47 milliseconds.
@jsulm Yes, both are release
Does it only start slowly on win 7 ?
I mean does it start normally on 8/10 ?
@mrjj I tested it on Win 10 only one time. The result is same. The first time took much more time than the second time, and much more time than other applications on that PC.
That computer doesn't install QT.
Well first time you launch the App, it has to load the Qt runtime DLLs so it will be longer.
however, i find it odd that it helps not using layouts.
@JerryZhu I would suggest to ask Qt developers on the mailing list as they know the Qt internals better.
@mrjj I guess application loads all Qt runtime DLLs before main function entry. The time I record is from the begin of QApplication constructor to the end of mainWindow.show. So the loading time shouldn't affect the results here.
And the total size of all DLLs won't be too big. I think the time can be ignored.
@jsulm Thank you. I will try it. Could you tell me where can I find the mailing list?