C++ container performance and efficiency