Hi.

Quote Originally Posted by IllegalCharacter
every time you call push_back with the vector it has to allocate a new array and copy all the elements into it again
Not 'every time'... but, usually (some implementations) when you reach the end of a vector it's resized to twice the original size. That's why iterators to vector can become invalid. Note, however, that a list will actually allocate memory for 'every' push back.

Anyway, if the file is always around this big, a first (and quick) attempt to improve performance is to initialize the vector with 400.000 elements. Try this and let us know.