Our story began when a customer gave us a medium-size C++/Qt code base (1M LOC). As usual, the customer was in a hurry, and so, consequently, were we. The full build of the codebase took about one hour. Nevertheless, in a read–eval–print loop (REPL), you rarely do a complete build, so this was not a problem. After a couple of days studying the code, we started programming.
But we found out quickly that even with just a one-line change, the compilation performed by our usual build script generator, CMake, took a long time, between 1 to 2 minutes. And no, there was no change in a header file included everywhere or even heavily templated code.
It seemed to me that something was wrong, so I fired up the Task Manager to get some insight. I quickly realised that when I started building the project, cmake.exe kept the CPU busy at 100% for quite a long time. The latter was very strange, as I did not edit any CMakeLists.txt files. It was only after CMake finished and the compiler started, followed by the linker, that things speeded up and finished in a reasonable time of about 10s seconds.
Leave a Reply
Want to join the discussion?Feel free to contribute!