> On 3 Jan 2022, at 16:10, Sérgio Martins <sergio.mart...@kdab.com> wrote:
> 
> On 2022-01-03 13:40, Lars Knoll wrote:
>> (...)
>> One other possible solution to improve compile times is the hack we
>> used 15 years ago in KDE, where we grouped many .cpp files into one
>> compilation unit. There’s however a balance needed here, as it reduces
>> the efficiency of -j, but maybe compiling 4-8 .cpp files as one unit
>> could help.
> 
> Hello Lars,
> 
> "unity builds" were added to CMake by Christian Adam, you should read your 
> company blog :D
> It seems to adjust the size of the amalgamations so all your CPU cores are 
> still used.

Nice. Looks like I missed that one :)
> 
> The results are astonishing, clazy builds almost 100% faster. However, clazy 
> does use a lot of LLVM headers, which are
> known to be slow to compile. So your mileage will vary.
> 
> It does make incremental builds slower, as then you need to recompile the 
> entire amalgamation. For this reason I don't think
> it's a silver bullet.

It’s not. It’s a kludge. It can help you get your dependencies compiled faster, 
but it’s usually not very helpful for the code you’re actively working on. And 
as Thiago pointed out, it comes with its own share of issues.

Cheers,
Lars

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to