Qt 6 compiles twice slower that Qt 5
-
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 -
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 -
@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
-
-
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.
@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.
-
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.
- use
-
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.
@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?! - use
-
@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?!@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.
-
@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.
@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.
-
@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
@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. :-)
-
@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.
@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 -
@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.
@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.)