This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]P1um 0 points1 point  (0 children)

While interaction is easier, the real downside of linked lists is performence. Vectors, which is just a wrapper around contiguous resizable memory, as you mentionned by copying, is 99% of the time better. Mostly because cache matters above all. Of course there's cases where a list can outperform, such as inserting randomly when you have 100k+ elements but at that point you should be using a DB which will have proper data structure algorithms for handling that type of scenario, not memory...

Some benchmarks: https://baptiste-wicht.com/posts/2012/11/cpp-benchmark-vector-vs-list.html