[PATCH] Lazy loading for late parsed templates

Richard Smith richard at metafoo.co.uk
Wed Feb 19 17:06:52 PST 2014


You can't use C++11 in Clang sources yet. (This patch uses 'nullptr',
'auto', range-based for loops.)

On Tue, Feb 18, 2014 at 12:03 PM, Will Wilson <will at indefiant.com> wrote:

> *ping*
>
>
> On 10 February 2014 14:59, Will Wilson <will at indefiant.com> wrote:
>
>> Hi All,
>>
>> I've had a crack at implementing lazy loading for late parsed templates
>> (used by MSVCCompat) as I've noticed that they add unnecessary overhead to
>> compilation using large PCHs. This is especially true for small files
>> compiled with large PCH files containing many templated functions - they
>> were all being deserialized but most never got used.
>>
>> A quick analysis on a file in a large code base shows the AST parsing
>> time time dropping from 0.58s without the change and 0.37s with the change.
>> This is with 699/7333 late parsed templated loaded and parsed from the PCH.
>>
>
The code changes look great, thanks!


> I've added the data structures to the ModuleFile class to follow
>> convention, although I haven't added any new tests as I doubt if anyone's
>> likely to use modules with late template parsing enabled. However, at least
>> the option is there should someone want to use (and test) it with modules
>> in the future. That said, all existing test pass with this patch.
>>
>
Please provide some tests using this functionality.


> Formatted and tested patch attached ready for review.
>>
>> Cheers,
>> Will.
>>
>
>
>
> --
> *Indefiant Ltd.*
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140219/60d46a61/attachment.html>


More information about the cfe-commits mailing list