simonon Stack Overflow • Recommends
On “Linked List vs Vector”
I don't like the number one answer here so I figured I'd share some actual research into this conducted by Herb Sutter from Microsoft. The results of the test was with up to 100k items in a container, but also claimed that it would continue to out perform a linked list at even half a million entities. Unless you plan on your container having millions of entities, your default container for a dynamic container should be the vector. I summarized more or less what he says, but will also link the reference at the bottom:
"Even if you preallocate the nodes within a linked list, that gives you half the performance back, but it's still worse than a vector. Why? First of all it's more space --…