Reputation: 14473
I tried the benchmark on this site: Array vs. Vector vs. Linked list. It tests the performance of iterating over said sequences.
Remarkably, iterating over a linked list is approximately 2.5x faster than a Vector.<int>
. What is the reason for this counter-intuitive result?
Upvotes: 2
Views: 975
Reputation: 436
Bounds checking and the indexing function call could be contributing a large chunk of the inefficiency.
Upvotes: 1