![](/img/trans.png)
[英]Why is one algorithm faster than the other (adding numbers with linked list)
[英]Why is a linked list faster than Vector in AS3?
我在該網站上嘗試了基准測試: 數組vs.矢量vs.鏈表 它測試在所述序列上迭代的性能。
值得注意的是,在鏈表上進行迭代的速度比Vector.<int>
快約2.5倍 。 產生這種違反直覺的結果的原因是什么?
邊界檢查和索引函數調用可能導致效率低下。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.