]> granicus.if.org Git - clang/commit
Pool allocate ImplicitConversionSequences.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 14 Jan 2012 16:32:05 +0000 (16:32 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 14 Jan 2012 16:32:05 +0000 (16:32 +0000)
commit09dd3798e100ace40defdc5541277502346213f2
tree69decdebd982bb39d1f87d022ca45ddf23e9c704
parent0e6a16f3e8c8d80a61e89848d216972aa8daea27
Pool allocate ImplicitConversionSequences.

To avoid malloc thrashing give OverloadCandidateSet an inline capacity for conversion sequences.
We use the fact that OverloadCandidates never outlive the OverloadCandidateSet and have a fixed
amount of conversion sequences.

This eliminates the oversized SmallVector from OverloadCandidate shrinking it from 752 to 208 bytes.

On the test case from the "Why is CLANG++ so freaking slow" thread on llvmdev this avoids one gig
of vector reallocation (including memcpy) which translates into 5-10% speedup on Lion/x86_64.

Overload candidate computation is still the biggest malloc contributor when compiling templated
c++ code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148186 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Overload.h
lib/Sema/SemaOverload.cpp