Author: aaronballman Date: Tue Aug 16 09:48:39 2016 New Revision: 278812 URL: http://llvm.org/viewvc/llvm-project?rev=278812&view=rev Log: Reduce the number of allocations required for AST attributes. In test cases, the max resident memory changed from 65760k to 64476k which is 1.9% improvement. Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler. Overall running time remained the same.
Patch by Eugene Kosov Modified: cfe/trunk/include/clang/AST/AttrIterator.h Modified: cfe/trunk/include/clang/AST/AttrIterator.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/AttrIterator.h?rev=278812&r1=278811&r2=278812&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/AttrIterator.h (original) +++ cfe/trunk/include/clang/AST/AttrIterator.h Tue Aug 16 09:48:39 2016 @@ -39,8 +39,7 @@ void operator delete[](void *Ptr, const namespace clang { /// AttrVec - A vector of Attr, which is how they are stored on the AST. -typedef SmallVector<Attr*, 2> AttrVec; -typedef SmallVector<const Attr*, 2> ConstAttrVec; +typedef SmallVector<Attr *, 4> AttrVec; /// specific_attr_iterator - Iterates over a subrange of an AttrVec, only /// providing attributes that are of a specific type. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits