This patch makes template instantiations be already performed in the PCH instead of it being done in every single file that uses the PCH (but every single file will still do it as well in order to handle its own instantiations). I can see 20-30% build time saved with the few tests I've tried.
The delaying of template instantiations until the PCH is used comes from 7f76d11dcc9196e1fc9d1308da9ed2330a6b06c2 , which doesn't really give any useful reasoning for it, except for extending a unittest, which however now passes even with the instantiation moved back into the PCH. The only way this breaks things that I've managed to find is if a .cpp file using the PCH adds another template specialization that's not mentioned in the PCH, which is why this needs to be enabled by a flag, but PCHs often require tweaking, and in this case e.g. adding a forward declaration for the specialization seems to be very well worth it, in the rare case it happens.
I've built a complete debug build of LibreOffice with the patch and everything seems to work fine.
The change itself is trivial, but ~22 tests fail merely because this change reorders things differently than the tests expect, without any actual change.