Re:Vector successive insertion much faster than list
by jesstaa on Thursday August 04, 2011 @09:41PM
(#2848624)
As with everything, it depends.
If you have large data structures then the overhead of a vector's over-allocation and eventual copying (possibly multiple times) might be an issue.
Re:Vector successive insertion much faster than list
by matthewnourse on Thursday August 04, 2011 @11:52PM
(#2848899)
I'd love to see where the crossover point is on different architectures...especially when the size of the collection is just over the CPU's L1 cache size. I wonder if the vector's 1-or-many cache miss(es) would exceed the cost of the list's guaranteed-one-or-two cache miss(es).