STL容器性能概述

时间:2011-10-19 06:41:09

标签: c++ performance boost stl containers

  

可能重复:
  What are the Complexity guarantees of the standard containers?

从我昨天的问题std::queue<T, list<T> >::size() is slow in O(n)?的答案中我了解到,我对STL容器性能特征的假设并不总是正确的。是时候学习了!

您是否知道任何“作弊表”,例如关于常见STL(也可能是Boost)容器的概述,例如vectorlistdequemap,{ {1}} / hash_map等关于插入,删除,尺寸()等操作的性能特征(如标准所示)?

1 个答案:

答案 0 :(得分:3)

有一个漂亮的图表可以比较所有标准库容器的性能 here

相关问题