Re: Profiling compilation time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yang Zhang <yanghatespam@xxxxxxxxx> writes:

>> PCHs help with a large fraction of parsing and name lookup for those
>> header files which are included in the PCH.  The PCH implementation is
>> limited in that you can only include a single PCH in a compilation, and
>> it must be the thing which include first.  The more of your header files
>> that you can put into a single PCH, the more PCH will help you.
>> However, for the large projects which I have worked on, there is no
>> reasonable way to create a single large PCH which works across the
>> project, because different parts of the code use different sets of
>> header files, and it is not desirable to expose every part of the code
>> to every other part of the code.
>
> Is this because, once created, the cost of including a PCH scales with
> the PCH's total size, and not with the just the size of the parts
> used/consumed by the including source?

No, the cost of including a PCH is more or less constant.  It's because
in a large project (hundreds of thousands of lines of code or more)
subproject A should not see the internal header files of subproject B.
Certainly it's possible to use separate PCHs for separate subprojects,
but as you create more PCHs the returns diminish and the complexity
increases.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux