Original Post
I need to search into a std::vector , with a size of about 20000. The search needs to be done in opengl-application main loop, and it's extremely slow.
This is my code:
Please tell me there are alternatives to to this search faster. I've read that std::map would allow to improve perfomances, but didn't understand how to implement that.
Or, would a simple dynamic array be faster than a std::vector ?
Thanks
This is my code:
std::vector<int> folliclesArray;
for (int i=0; i<LIMIT; i++)
{
iter = std::find(folliclesArray.begin(), folliclesArray.end(), i);
if (iter!=folliclesArray.end()) dosomething();
}
Please tell me there are alternatives to to this search faster. I've read that std::map would allow to improve perfomances, but didn't understand how to implement that.
Or, would a simple dynamic array be faster than a std::vector ?
Thanks