Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Widgets Application start up very slowly
Forum Updated to NodeBB v4.3 + New Features

Qt Widgets Application start up very slowly

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 1.7k Views 3 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
    JerryZhu
    wrote on last edited by
    #1

    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?

    jsulmJ 1 Reply Last reply
    0
    • J JerryZhu

      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?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JerryZhu Are you testing release build?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      0
      • J Offline
        J Offline
        JerryZhu
        wrote on last edited by
        #3

        Yes, both are release

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JerryZhu
          wrote on last edited by
          #4

          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.
          0_1551260876670_捕获.PNG

          1 Reply Last reply
          0
          • jsulmJ jsulm

            @JerryZhu Are you testing release build?

            J Offline
            J Offline
            JerryZhu
            wrote on last edited by
            #5

            @jsulm Yes, both are release

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              Does it only start slowly on win 7 ?
              I mean does it start normally on 8/10 ?

              J 1 Reply Last reply
              0
              • mrjjM mrjj

                Hi
                Does it only start slowly on win 7 ?
                I mean does it start normally on 8/10 ?

                J Offline
                J Offline
                JerryZhu
                wrote on last edited by
                #7

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

                mrjjM jsulmJ 2 Replies Last reply
                0
                • J JerryZhu

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

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

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

                  J 1 Reply Last reply
                  1
                  • J JerryZhu

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

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @JerryZhu I would suggest to ask Qt developers on the mailing list as they know the Qt internals better.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    J 1 Reply Last reply
                    1
                    • mrjjM mrjj

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

                      J Offline
                      J Offline
                      JerryZhu
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @JerryZhu I would suggest to ask Qt developers on the mailing list as they know the Qt internals better.

                        J Offline
                        J Offline
                        JerryZhu
                        wrote on last edited by
                        #11

                        @jsulm Thank you. I will try it. Could you tell me where can I find the mailing list?

                        jsulmJ 1 Reply Last reply
                        0
                        • J JerryZhu

                          @jsulm Thank you. I will try it. Could you tell me where can I find the mailing list?

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @JerryZhu Here: https://lists.qt-project.org/

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          • Login

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