Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在这个网站上尝试了基准测试:Array vs. Vector vs. Linked list。它测试迭代所述序列的性能。
值得注意的是,遍历链表的速度大约是2.5倍Vector.<int>。这种反直觉结果的原因是什么?
Vector.<int>
边界检查和索引函数调用可能是造成效率低下的主要原因。