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
16 Posts 8 Posters 2.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.
  • 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 on 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 on 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 on 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 on 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 on 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 on 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 on 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. :-)

                Y 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 on 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 on 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
                    • Andy314A Andy314

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

                      Y Offline
                      Y Offline
                      yandingyuan
                      wrote on last edited by
                      #16

                      @Andy314 I have also encountered the same problem. Has the issue of slow qt6 compilation been resolved?

                      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