2

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?

animuson
  • 53,861
  • 28
  • 137
  • 147
Stefan Dragnev
  • 14,143
  • 6
  • 48
  • 52

1 Answers1

1

Bounds checking and the indexing function call could be contributing a large chunk of the inefficiency.

arithma
  • 438
  • 5
  • 13