Projekt compile time with Qt 6 much slower than Qt 5
-
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:45This makes a big difference in the productivty. Is this effect normal or is something wrong ?
-
Please test you Qt5 compile time with c++17 enabled. This should make a big difference.
-
Please test you Qt5 compile time with c++17 enabled. This should make a big difference.
@Christian-Ehrlicher So C++17 compilation could be substantially slower than older versions? Sad... :(
-
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++17I forgot, I use a 12 core CPU with hyperthreading -> 24 threads !
-
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++17I forgot, I use a 12 core CPU with hyperthreading -> 24 threads !
@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 ;)
-
@Christian-Ehrlicher So C++17 compilation could be substantially slower than older versions? Sad... :(
@JonB yes, because of all the new headers with a lot of template stuff. That's the main reason why Qt6 builds slower.
-
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.
-
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 -
If you're still on Windows 10, a RAM disk drive could speed up the compile times, e.g. ImDisk
@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%