Slow startup of QWS
My application is very slow on first startup.
My board is a 400MHz ARM9 (iMX27) running from NAND flash.
When I first try to start my application (with -qws) the screen remains blank for about 20s.
I then briefly get a green background and a mouse pointer before my application starts and hides the mouse.
If I quite my application and start it again, it start instantly (again with brief green screen and mouse pointer).
Any ideas why the first start would take so long!
I also tried with a simple ‘Hello World’ test and it does the same.
..edit …. I’m using Qt 4.7.1
I have the same problems on an other board (Freescale 5121e PPC). I have the following software config: gcc 4.3.2, Linux Kernel 184.108.40.206, Qt everrywhere open source 4.7.2
I tried with Qt static and dynamic, the results do not differ significantly.
I tried the following app-types:
Qt Gui application with QApplication, size about 11 Megs (static linked), first run takes about >20 secs
Qt Console App with QCoreApplication, which just prints out a “Hello”, size stripped about 2 Megs, takes about 10 secs for the first run.
A “Hello World” C-Programm with printf needs just a few millisecs.
As described from Jinxxy, quitting the application and starting again, has almost no delays.
Any suggestions, what causes the delay or where to begin looking for the causes?
The device boots from network and mounts its rootfs over nfs. To avoid network and io delays, I copied the app before starting into /tmp, which is tmpfs residing in ram, meaning the delay should be very minimal compared to any flash or network drive. All the kernel drives are compiled into the kernel and not as modules. I also tested the following:
I start a qt-based app, which is staticly linked with qt-libs. The start is delayed as described above. Then I quit the app and start another qt-based app, which is also staticly linked. Also the second app shows the huge delay. All apps are always copied into /tmp before executing.
OK so you need to profile to see what is going on but since you say a simple hello world app takes 10s to start up it sounds as if the problem is within Qt. I would suggest building a debug version of your app and remotely debugging it on your target device (you should be able to spot a 10s delay as you step through the code). Also worth running some profiling tool too to see if that gives any clues.
Any updates? I am running into the exact same issue (long load time on first run) on my ARM device. I am using QT 4.7.3
Btw, Jinxyy, you can minimize the amount of time the mouse stays on the screen by calling “QWSServer::setCursorVisible(false)” immediately after constructing your QApplication. I haven’t found a way to eliminate it completely, however.
Here is my latest update regarding startup:
I had the same issues. Than, I enabled in the linux kernel fs-caching. After that, my qt app starts up in about 8-9 secs.
I changed nothing in qt-code. qt-libs are static-compiled. the app is about 7MB static and stripped. After all these changes, the app starts up at least with the same delay on the first and other runs.
By the way, the app uses directfb. When switched to LinuxFB, it starts up slightly faster (about 5-6 secs), but than blitting performance is bad.
So, I believe startup problem was due to kernel config. On the other side, still, the whole system is far far away from the “1 second linux”, where you can find a demo-video on internet, on which they boot linux+qt app in 1 sec….
I have been experiencing the same issue on Qt 4.7 and Qt 4.8. I am running a JFFS2 filesystem and my total boot time is broken down by ~10 seconds to get LCD splashed, Kernel copied from NAND, uncompressed and running in LPDDR, ~6 seconds of init stuff, ~10 seconds of JFFS2 file system mounting, and around ~24 seconds to get my App / Qt to main menu. 400 MHz ARM 9 with 95 MHz LPDDR. I am going to try the above idea with fs-caching.