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 6 compiles twice slower that Qt 5
Forum Updated to NodeBB v4.3 + New Features

Qt 6 compiles twice slower that Qt 5

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 7 Posters 1.5k 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote last edited by aha_1980
    #1

    Hello,
    I have compared Qt 5.15.2 and 6.7.3 MSVC 2019-64 with the same project. The time for a full rebuid increases from 1:12 to 2:27 (12-Core, 24 threads)

    This I a big back step. Is this normal or can I configure something to increase the speed.

    Thank you for help
    Andreas

    J.HilkJ 1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote last edited by JoeCFD
      #2

      are you using cmake or qmake?

      Andy314A 1 Reply Last reply
      0
      • Andy314A Andy314

        Hello,
        I have compared Qt 5.15.2 and 6.7.3 MSVC 2019-64 with the same project. The time for a full rebuid increases from 1:12 to 2:27 (12-Core, 24 threads)

        This I a big back step. Is this normal or can I configure something to increase the speed.

        Thank you for help
        Andreas

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote last edited by
        #3

        @Andy314 did you forget to add the number of parallel jobs/threads in your project settings?

        From experience, MSCV/jom projects are, for what ever reason, always single threaded by default


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        JoeCFDJ Andy314A 2 Replies Last reply
        2
        • J.HilkJ J.Hilk

          @Andy314 did you forget to add the number of parallel jobs/threads in your project settings?

          From experience, MSCV/jom projects are, for what ever reason, always single threaded by default

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote last edited by
          #4

          @J.Hilk Good point!

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote last edited by
            #5

            See https://forum.qt.io/topic/142309/

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote last edited by
              #6

              Plus cmake is slow for build. When I tried to build gstreamer before, meson is 10 times faster than cmake. Gstreamer has dropped cmake and uses meson only now.

              Christian EhrlicherC 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                Plus cmake is slow for build. When I tried to build gstreamer before, meson is 10 times faster than cmake. Gstreamer has dropped cmake and uses meson only now.

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote last edited by
                #7

                @JoeCFD said in Qt 6 comiles twice slower that Qt 5:

                Plus cmake is slow for build. When I tried to build gstreamer before, meson is 10 times faster than cmake. Gstreamer has dropped cmake and uses meson only now.

                The build system is not really relvant. It's the compiler which is doing the job, not the build system.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                2
                • cristian-adamC Offline
                  cristian-adamC Offline
                  cristian-adam
                  wrote last edited by
                  #8

                  I've reported this back in October 2021. See https://bugreports.qt.io/browse/QTBUG-97601

                  It's the new C++ features in Qt 6 that make things slow. So you would have to ... embrace the suck!

                  Things that can help:

                  • use ccache to cache compilation
                  • use an opensource compiler that you can optimize on your code base
                  • similarly a better operating system.

                  For the last point, apparently you can get 10-20% speed up using MSVC on Linux using Wine.

                  At some point we'll have C++ modules that would help with the speed. But that's like 10-20 years in the future.

                  Pl45m4P 1 Reply Last reply
                  1
                  • cristian-adamC cristian-adam

                    I've reported this back in October 2021. See https://bugreports.qt.io/browse/QTBUG-97601

                    It's the new C++ features in Qt 6 that make things slow. So you would have to ... embrace the suck!

                    Things that can help:

                    • use ccache to cache compilation
                    • use an opensource compiler that you can optimize on your code base
                    • similarly a better operating system.

                    For the last point, apparently you can get 10-20% speed up using MSVC on Linux using Wine.

                    At some point we'll have C++ modules that would help with the speed. But that's like 10-20 years in the future.

                    Pl45m4P Offline
                    Pl45m4P Offline
                    Pl45m4
                    wrote last edited by
                    #9

                    @cristian-adam said in Qt 6 comiles twice slower that Qt 5:

                    C++ modules

                    Aren't modules introduced to C++ in C++20/23?!
                    Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!


                    If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                    ~E. W. Dijkstra

                    cristian-adamC 1 Reply Last reply
                    0
                    • Pl45m4P Pl45m4

                      @cristian-adam said in Qt 6 comiles twice slower that Qt 5:

                      C++ modules

                      Aren't modules introduced to C++ in C++20/23?!
                      Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!

                      cristian-adamC Offline
                      cristian-adamC Offline
                      cristian-adam
                      wrote last edited by
                      #10

                      @Pl45m4 said in Qt 6 comiles twice slower that Qt 5:

                      Aren't modules introduced to C++ in C++20/23?!
                      Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!

                      Yes, as of today (may 2025) we could use the latest versions of the three compilers to build C++ code with modules.

                      But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                      Christian EhrlicherC Pl45m4P S 3 Replies Last reply
                      0
                      • cristian-adamC cristian-adam

                        @Pl45m4 said in Qt 6 comiles twice slower that Qt 5:

                        Aren't modules introduced to C++ in C++20/23?!
                        Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!

                        Yes, as of today (may 2025) we could use the latest versions of the three compilers to build C++ code with modules.

                        But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote last edited by
                        #11

                        @cristian-adam said in Qt 6 comiles twice slower that Qt 5:

                        But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                        That happens when you basically rename "precompiled headers" to "modules" and leave the stuff for the different compilers so that you e.g. can't share them between each other. The idea sounds good but the implementation from the standardization size is horrible in my pov.

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          are you using cmake or qmake?

                          Andy314A Offline
                          Andy314A Offline
                          Andy314
                          wrote last edited by
                          #12

                          @JoeCFD said in Qt 6 compiles twice slower that Qt 5:

                          are you using cmake or qmake?

                          I use qmake.

                          1 Reply Last reply
                          0
                          • J.HilkJ J.Hilk

                            @Andy314 did you forget to add the number of parallel jobs/threads in your project settings?

                            From experience, MSCV/jom projects are, for what ever reason, always single threaded by default

                            Andy314A Offline
                            Andy314A Offline
                            Andy314
                            wrote last edited by
                            #13

                            @J.Hilk said in Qt 6 compiles twice slower that Qt 5:

                            @Andy314 did you forget to add the number of parallel jobs/threads in your project settings?

                            From experience, MSCV/jom projects are, for what ever reason, always single threaded by default

                            CPU is burning and uses all possibe threads. :-)

                            1 Reply Last reply
                            0
                            • cristian-adamC cristian-adam

                              @Pl45m4 said in Qt 6 comiles twice slower that Qt 5:

                              Aren't modules introduced to C++ in C++20/23?!
                              Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!

                              Yes, as of today (may 2025) we could use the latest versions of the three compilers to build C++ code with modules.

                              But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                              Pl45m4P Offline
                              Pl45m4P Offline
                              Pl45m4
                              wrote last edited by
                              #14

                              @cristian-adam said in Qt 6 compiles twice slower that Qt 5:

                              But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                              This is gold :D
                              Estimated finish in 2344


                              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                              ~E. W. Dijkstra

                              1 Reply Last reply
                              0
                              • cristian-adamC cristian-adam

                                @Pl45m4 said in Qt 6 comiles twice slower that Qt 5:

                                Aren't modules introduced to C++ in C++20/23?!
                                Or what do you mean with "we"? Qt actually using (and benefiting from) C++ modules?!

                                Yes, as of today (may 2025) we could use the latest versions of the three compilers to build C++ code with modules.

                                But, the libraries are not there. See https://arewemodulesyet.org/ for the amazing progress that is being done by the community.

                                S Offline
                                S Offline
                                SimonSchroeder
                                wrote last edited by
                                #15

                                @cristian-adam said in Qt 6 compiles twice slower that Qt 5:

                                Yes, as of today (may 2025) we could use the latest versions of the three compilers to build C++ code with modules.

                                It is quite overwhelming to compile such a large library as Qt if you are still a beginner or even if you are at an intermediate level. I believe MSVC is doing it right. But, at least one of the other compilers makes modules incompatible if different compiler flags are used. Which would actually mean you need to compile Qt with the compiler flags you are using for your project to be able to use C++ modules with Qt. The future with modules is not as bright as it was promised. (Microsoft has also proposed a module standard exchange format that all compilers could/should use. If supported this could solve this problem.)

                                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