Recently found realy helpful container decesion chart (in attachments).
and Ive read some articles and forums and found... eg:
Quote:
Firstly, finding an item in a very small vector can easily be faster than the same thing in a map, because all the memory in a vector is always contiguous (and so plays more nicely with computers' caches and such things), and the number of comparisons needed to find something in a vector might be about the same as for a map. Finding an element in a map needs fewer operations in the limit of very large containers.
The point where maps become faster than vectors depends on the implementation, on your processor, what data is in the map, and subtle things like what memory is in the processor's cache. Typically, the point where map becomes faster would be about 5-30 elements.
|
Ill try the map instead and hope that it will be faster, vector is definatelly not for my use ... so it at least worth to try...
Thanks very much.