Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Slow startup of QWS

Slow startup of QWS

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 6 Posters 9.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jinxxy
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      denizlitr
      wrote on last edited by
      #2

      I have the same problems on an other board (Freescale 5121e PPC). I have the following software config: gcc 4.3.2, Linux Kernel 2.6.33.5, 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?

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        I've seen this caused by very slow onboard flash devices in the past. If subsequent startups are much quicker (due to files being cached) then take a look at the IO performance of your storage device.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Oh another idea, make sure that all the necessary kernel drivers are loaded and have had time to initialise before you start your app for the first time.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • D Offline
            D Offline
            denizlitr
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              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.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0
              • M Offline
                M Offline
                magikaru
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  joan
                  wrote on last edited by
                  #8

                  Hello
                  Please, someone has solved the problem. I have the same problem on a Freescale ARM.
                  The first time I run the program works very slow. I close the program and run it back and working properly.
                  Thank you.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    denizlitr
                    wrote on last edited by
                    #9

                    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....

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      gsinde
                      wrote on last edited by
                      #10

                      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.

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        gsinde
                        wrote on last edited by
                        #11

                        So, we decided to switch from JFFS2 to UBI and the boot time changed from a total of 52 seconds down to 22 seconds with no other change. Apparently JFFS2 is not a good choice as these NAND's are getting larger and the embedded devices are using more and more files.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved