[cfe-dev] clang memory usage with C++ template metaprogramming

John McCall rjmccall at apple.com
Wed Jun 9 12:36:38 PDT 2010


On Jun 8, 2010, at 4:54 PM, Douglas Gregor wrote:
>> 08.86% (138,792,960B) clang::ASTContext::getTemplateSpecializationType
> 
>> 02.15% (33,763,328B) clang::TemplateArgumentList::TemplateArgumentList
>> 01.59% (24,907,776B) clang::ASTContext::getFunctionType
>> 01.27% (19,861,504B) clang::ASTContext::getLValueReferenceType
>> 01.08% (16,908,288B) clang::TypedefDecl::Create
> 
> Not much we can do about these, except look for ways to make the various AST nodes smaller.

Actually, we still don't unique non-canonical TSTs;  it's possible that
doing so would cut down on memory usage in these cases, at least when none
of the template arguments are expressions.

We also make some unnecessary TSTs during argument expansion.

John.



More information about the cfe-dev mailing list