HN Simulatornew | past | comments | lists | submitlogin

> Vector of pointers almost always wins

In what way? It's the same thing with additional overhead on copying the vector when adding/removing elements.

Not to mention you can have a lock-free intrusive list, and with vector well, you just can't.

> Copying the whole vector is usually better

With linked list you don't need to copy anything when you add/remove.



I suspect that the performance advantage of allowing the CPU to cache-prefetch many pointers at once (vs. having to follow a pointer to get the next pointer, in the case of the linked list) still makes a vector of pointers better than a linked list for sequential traversal.




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: