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. Projekt compile time with Qt 6 much slower than Qt 5

Projekt compile time with Qt 6 much slower than Qt 5

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 7 Posters 792 Views
  • 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.
  • A Offline
    A Offline
    Andy314
    wrote on 3 Jun 2024, 11:49 last edited by
    #1

    Hello,

    I am on the way to switch my project from Qt 5.15.2 to 6.4.3 with MSVC 2019 - 64 bit. I was very disappointed about the slow compile time.

    Qt 5: 59 sec
    Qt 6 1:45

    This makes a big difference in the productivty. Is this effect normal or is something wrong ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 3 Jun 2024, 11:52 last edited by
      #2

      Please test you Qt5 compile time with c++17 enabled. This should make a big difference.

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

      J 1 Reply Last reply 3 Jun 2024, 12:43
      0
      • C Christian Ehrlicher
        3 Jun 2024, 11:52

        Please test you Qt5 compile time with c++17 enabled. This should make a big difference.

        J Offline
        J Offline
        JonB
        wrote on 3 Jun 2024, 12:43 last edited by
        #3

        @Christian-Ehrlicher So C++17 compilation could be substantially slower than older versions? Sad... :(

        C 1 Reply Last reply 3 Jun 2024, 13:33
        0
        • A Offline
          A Offline
          Andy314
          wrote on 3 Jun 2024, 12:45 last edited by Andy314 6 Mar 2024, 12:49
          #4

          Cannot really understand what you mean. Make Qt 5 compiling as slow as Qt 6 compiling :-)
          I have integrated this line in the pro - file, but nothing changed in both compile times:
          CONFIG += C++17

          I forgot, I use a 12 core CPU with hyperthreading -> 24 threads !

          M 1 Reply Last reply 3 Jun 2024, 12:58
          0
          • A Andy314
            3 Jun 2024, 12:45

            Cannot really understand what you mean. Make Qt 5 compiling as slow as Qt 6 compiling :-)
            I have integrated this line in the pro - file, but nothing changed in both compile times:
            CONFIG += C++17

            I forgot, I use a 12 core CPU with hyperthreading -> 24 threads !

            M Offline
            M Offline
            mpergand
            wrote on 3 Jun 2024, 12:58 last edited by mpergand 6 Mar 2024, 13:02
            #5

            @Andy314
            maybe it's worth verifying if multi threads compilation is actived.
            It should be something like -j4 in the command line.

            [EDIT] you add that after my post:

            I forgot, I use a 12 core CPU with hyperthreading -> 24 threads !

            Yeah, make sense ;)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Andy314
              wrote on 3 Jun 2024, 13:18 last edited by
              #6

              I see in the taskmanager that all threads are in full working - the CPU is glowing ;-)

              1 Reply Last reply
              0
              • J JonB
                3 Jun 2024, 12:43

                @Christian-Ehrlicher So C++17 compilation could be substantially slower than older versions? Sad... :(

                C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 3 Jun 2024, 13:33 last edited by
                #7

                @JonB yes, because of all the new headers with a lot of template stuff. That's the main reason why Qt6 builds slower.

                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
                1
                • G Offline
                  G Offline
                  goldenhawking
                  wrote on 3 Jun 2024, 13:43 last edited by
                  #8

                  The compilation speed of C++is a magical thing. For machines with the same configuration, Linux GCC (Ubuntu x64) is twice as fast as VC, and VC is 2-3 times faster than msys2's GCC. If you heavily use C++templates on Raspberry Pi, it can be very time-consuming. Sometimes memory overhead can directly lead to computer downtime.

                  Qt is the best C++ framework I've ever met.

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hskoglund
                    wrote on 3 Jun 2024, 13:50 last edited by
                    #9

                    If you're still on Windows 10, a RAM disk drive could speed up the compile times, e.g. ImDisk

                    V 1 Reply Last reply 3 Jun 2024, 21:55
                    0
                    • V Offline
                      V Offline
                      Volker75
                      wrote on 3 Jun 2024, 21:50 last edited by Volker75 6 Mar 2024, 22:00
                      #10

                      Well, compile time is also slower with Linux. I didn't checked if it is mainly because of Qt 5 to Qt 6 or because of the newer gcc version. But it was always like this.
                      Don't forget that newer compiler also tries to detect more bugs and warnings. That need time.
                      In my opinion compile time is not too critical, even my project need much time to compile. Because in normal case I don't compile the whole project. In normal case I need to compile only a few changed files and that is in most cases very fast.
                      If the compiler is too slow, you might think about disabling the warnings.
                      Also the compilers are slower, because they have new algorithms how they can improve the run time speed! And in my case runtime speed is the most imported stuff that i need. If your runtime is not critical, then you might also think about compiling only with a lower optimization like -o1.
                      you can see a nice comparison on Linux with different compilers, Qt versions and 32 vs 64 bit in my YouTuve video:
                      https://www.youtube.com/watch?v=l6bFVfcvUpc

                      1 Reply Last reply
                      0
                      • H hskoglund
                        3 Jun 2024, 13:50

                        If you're still on Windows 10, a RAM disk drive could speed up the compile times, e.g. ImDisk

                        V Offline
                        V Offline
                        Volker75
                        wrote on 3 Jun 2024, 21:55 last edited by Volker75 6 Mar 2024, 21:55
                        #11

                        @hskoglund said in Projekt compile time with Qt 6 much slower than Qt 5:

                        If you're still on Windows 10, a RAM disk drive could speed up the compile times, e.g. ImDisk

                        You are sure that will help? Never tried with Windows, but with Linux.
                        I compiled my project with Linux.
                        One time on my fast SSD.
                        And the other time i connected a USB 2.0 sdCard reader and used my oldest and cheapest sdCard. So this device is much slower, but the compile time difference was below 1%

                        1 Reply Last reply
                        0

                        10/11

                        3 Jun 2024, 21:50

                        • Login

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