C++0x forward_list在不同场景下的性能如何
What is the performance of C++0x forward_list under different scenarios?
我一直在使用std::forward_list,其中我需要一个列表,但不需要双向迭代器,但如果能看到forward_li斯特在一系列配置的一系列场景下的性能分析,那就太好了,例如;
- forward_list::erase_after()与list::erase()
- forward_list::push_front()与list::push_filnt()
- std::next(forward_list::iterator,n)与std::next(list::iterate,n)
- forward_list::迭代器++与list::迭代器++
我已经在向量和数组中看到了很多这样的内容,在更新的forward_list中也可以看到它。
请只回答富有成效的问题。
forward_list
没有erase()
方法;我想你是指erase_after()
。
问题中的所有方法对都具有完全相同的渐近复杂度(std::next(it, n)
在n
中是线性的,其余的是恒定时间)。
相关文章:
- 删除一个线程上有数百万个字符串的大型哈希映射会影响另一个线程的性能
- OpenMP阵列性能较差
- 递归列出所有目录中的C++与Python与Ruby的性能
- 大小相等但成员数量不同的结构之间的性能差异
- 为什么constexpr的性能比正常表达式差
- 在类中使用随机生成器时出现性能问题
- 在main()之外初始化std::vector会导致性能下降(多线程)
- 完美前进使用 std::forward vs RefRefCast
- 海湾合作委员会 ARM 性能下降
- GCC 和 Clang 代码性能的巨大差异
- 在容量内调整矢量大小时的性能影响
- 了解算法的性能差异(如果以不同的编程语言实现)
- 未达到的情况会影响开关外壳性能
- QStringList vs list<shared_ptr<QString>> 性能比较C++
- 是否总是可以将使用递归编写的程序重写为不使用递归的程序C++,性能观点是什么?
- 哪种方法更好,性能明智
- C++ 特征库:引用的性能开销<>
- 与多个 for 循环与单个 for 循环 wrt 相关的性能从多映射获取数据
- 基于范围的 for 循环range_declaration中各种说明符之间的性能差异
- std::p mr::memory_resource 如何与 std::container 产生性能差异?