[memprof] Call SmallVector::reserve (#86055)
With one raw memprof file I have, NumPCs averages about 41. Given the default number of inline elements being 8 for SmallVector<uint64_t>, we should reserve the storage in advance.
This commit is contained in:
parent
796efa8cd5
commit
f5ef9bd26d
@ -127,6 +127,7 @@ CallStackMap readStackInfo(const char *Ptr) {
|
||||
endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
|
||||
|
||||
SmallVector<uint64_t> CallStack;
|
||||
CallStack.reserve(NumPCs);
|
||||
for (uint64_t J = 0; J < NumPCs; J++) {
|
||||
CallStack.push_back(
|
||||
endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user