[cfe-dev] PTH vs PCH usage

Vladimir Voskresensky voskresensky.vladimir at gmail.com
Sun Jan 8 10:22:30 PST 2012


Thanks for info.
Btw, any hints where to look in clang APIs/Impl for parts to be used for 
supporting fast incremental reparse/index-update in client which control 
editor/file changes?

Thanks,
Vladimir.

On 01/01/2012 10:37 PM, Douglas Gregor wrote:
> On Dec 28, 2011, at 1:12 PM, Vladimir Voskresensky wrote:
>
>> Hello,
>>
>> What kind of caching (i.e. for Indexing) should be used if Clang is to
>> be used from IDE-like applications for completion/x-ref features?
>> Does PCH is the right thing to use in such situations (at least I see it
>> mentioned in documentation for clang_createIndex)?
> PCH provides the best build-time and indexing-time improvements. I strongly recommend using it if you can, although it often requires that the user intervene by creating a prefix header that you can precompile.
>
>> What is the status of PTH? Is it live or deprecated?
> It's live. Performance gains from PTH are fairly limited… IIRC they were in the 10-20% range, which is far below what we tend to see with PCH.
>
>> Should it be used in interactive applications as cache mechanism as well?
>
> This idea has come up, although I don't know if anyone has tried it. Presumably, one could use PTH on all of the header files and then PCH for the prefix header, since the mechanisms compose.
>
> 	- Doug



More information about the cfe-dev mailing list