Stefan Dragnev
Stefan Dragnev

Reputation: 14473

Why is a linked list faster than Vector in AS3?

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

Answers (1)

arithma
arithma

Reputation: 436

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

Upvotes: 1

Related Questions