How to improve qtbase building times?
_BPL_ last edited by
Let's consider this little session on windows7+ visual studio2015:
- git clone https://github.com/qt/qtbase && mkdir build && cd build
- ptime %cd%..\configure.bat -prefix "d:/qt/whatever" -opensource -confirm-license -nomake examples -nomake tests -opengl dynamic
- jom build
And now take a look to these builds:
[5d7e221bbf] <=== cold build has already been made [e19d93b212] <=== git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q --hard e19d93b212d71521b7edd3a7e45e4b9319cd5c72 build 1) Execution time: 1359.352 s build 2) Execution time: 6.483 s build 3) Execution time: 6.514 s build 4) Execution time: 11.702 s (modified qaction.cpp) build 5) Execution time: 6.711 s [399bf44577] <=== git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q --hard 399bf445771936648691c48bebca500b36ae69dd build 6) Execution time: 6.538 s [5d7e221bbf] <=== git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q --hard e19d93b212d71521b7edd3a7e45e4b9319cd5c72 build 7) Execution time: 441.108 s build 8) Execution time: 6.514 s [57eed823e4] <=== git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q --hard e19d93b212d71521b7edd3a7e45e4b9319cd5c72 build 9) Execution time: 463.733 s
I've got some questions about it:
- Why build1, build7 and build9 are so high? If you take a look to the commit tree you'll see the commits I've tested are pretty similar and they're just modifying very little few files... I'd expect all the builds to live in the range of [0-20s] :/
- How can I build qtbase only in release mode? A lot of time goes into generating debug info... in fact, visual studio generates these .pch files which will be roughly
1.4gb. If I'm doing bug hunting I probably don't need any debug library at all
- Do you know any reliable tool like ccache I can use with visual studio? After a bit of googling I've found this python clcache tool but not sure yet if will help out in this particular case, look at this issue -> https://github.com/frerich/clcache/issues/347
- Related to 1... is it a good idea to use
git --reset hardor this command could be messing up somehow with the timestamps?
Anyway, any tip you may have in order to speed up buildings of qtbase will be really appreciated. For me iteration times of [0-20s] are fine, I can live with that... but times higher than that are a real bottleneck that makes development to become really difficult.
Why do you compile the whole qtbase when you only modify in src/plugins/platforms/android/ ?
Disabling the debug information can be done by modifying the corresponding mkspec but it somehow makes no sense to me since you say you're debugging qt so why don't you want debug information?
Don't use msvc2015 but 2017 or 2019 due to e.g. https://devblogs.microsoft.com/cppblog/faster-c-build-cycle-in-vs-15-with-debugfastlink/