The push_back benefit survives inlining. With this optimization (which has been merged to LLVM earlier today) the generated assembly doesn't need to save this and x to the stack frame.
The std::vector::push_back is slow in both libc++ and libstdc++ section shows that std::vector::push_back always needs a stack frame, strictly worse than SmallVector::push_back.
View all comments
Show parent comment
4
u/MaskRay ccls Jun 28 '26
The
push_backbenefit survives inlining. With this optimization (which has been merged to LLVM earlier today) the generated assembly doesn't need to savethisandxto the stack frame.The
std::vector::push_back is slow in both libc++ and libstdc++section shows thatstd::vector::push_backalways needs a stack frame, strictly worse than SmallVector::push_back.