The size of VTList that is pushed into this container is usually 1, but often 6 or 7. Change the vector to SmallVector to eliminate frequent mallocs.
This happens hundreds of thousands of times in each tablegen execution during the LLVM/clang build.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Reserve space in a vector to reduce the number of mallocs. The size of VTList is usually 1, but often 6 or 7.
It seems to me that SmallVector fits the need better than std::vector here?
Also curious how did you discover this?