[Development] Qt Compilation Speed
Thiago Macieira
thiago.macieira at intel.com
Mon Jan 3 19:14:20 CET 2022
On Monday, 3 January 2022 12:10:04 -03 Sérgio Martins via Development wrote:
> 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. Unless we're careful with the code we write, merging two .cpp into
one may produce problems, hopefully failure to build, but could cause the
wrong overload of something to be called and thus produce some silent data
corruption. That happens because now one TU's declarations declarations become
visible to another, usually because of unnamed-namespace or static content,
but it could simply be because of other private headers becoming visible.
In other words, it's something we have to maintain. And if unity builds can
change the amalgamation size, then we have to test the worst case scenario,
which is (almost*) all sources in one.
* almost because there are a couple of files that cannot be merged, like the
definitions for member functions that only exist for binary compatibility
mode, or the other-sub-architecture builds, though I'll work over the next
quarter to remove the latter in favour of plain __attribute__((target)).
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel DPG Cloud Engineering
More information about the Development
mailing list