Use a bump pointer allocator in the callee set creation.

Shaves about 19% of the time from the construction of these sets. The
SmallVector size was chosen to minimize the number of dynamic
allocations we end up doing while building the stdlib. This should be a
reasonable size for most projects, too. It's a bit wasteful in space,
but the total amount of allocated space here is pretty small to begin
with.
This commit is contained in:
Mark Lacey
2016-05-11 17:01:02 -07:00
parent 405fb1339d
commit 921dededad
2 changed files with 7 additions and 6 deletions

View File

@@ -56,7 +56,7 @@ CalleeCache::getOrCreateCalleesForMethod(SILDeclRef Decl) {
if (Found != TheCache.end())
return Found->second;
auto *TheCallees = new Callees;
auto *TheCallees = new (Allocator.Allocate()) Callees;
bool canCallUnknown = !calleesAreStaticallyKnowable(M, Decl);
CalleesAndCanCallUnknown Entry(TheCallees, canCallUnknown);