Stop using precompiled headers for Linux?

Aleksey Shipilev shade at redhat.com
Thu Nov 1 10:54:24 UTC 2018


On 11/01/2018 11:43 AM, Magnus Ihse Bursie wrote:
> But then again, it might just signal that the list of headers included in the PCH is no longer
> optimal. If it used to be the case that ~100 header files were so interlinked, that changing any of
> them caused recompilation of all files that included it and all the other 100 header files on the
> PCH list, then there was a net gain for using PCH and no "punishment".
> 
> But nowadays this list might be far too large. Perhaps there's just only a core set of say 20 header
> files that are universally (or almost universally) included, and that's all that should be in the
> PCH list then. My guess is that, with a proper selection of header files, PCH will still be a benefit.

I agree. This smells like inefficient PCH list. We can improve that, but I think that would be a
lower priority, given the abundance of CPU power we use to compile Hotspot. In my mind, the decisive
factor for disabling PCH is to keep proper includes at all times, without masking it with PCH. Half
of the trivial bugs I submit against hotspot are #include differences that show up in CI that builds
without PCH.

So this is my ideal world:
 a) Efficient PCH list enabled by default for development pleasure;
 b) CIs build without PCH all the time (jdk-submit tier1 included!);

Since we don't yet have (a), and (b) seems to be tedious, regardless how many times both Red Hat and
SAP people ask for it, disabling PCH by default feels like a good fallback.

-Aleksey



More information about the build-dev mailing list