Let's say I have a function:
void someFunc(void) {
std::vector<std::string> contentVector;
// here are some operations on the vector
}
The function is called many times. And profiler shows hight percentage CPU usage of std::__u::vector::vector and std::__u::vector::~vector.
Does it make sense to create the vector outside of the function and call .clear() in the beginning of the functions?
The same question for other standard containers.