find()方法获取时间search-c ++

map<int, GCCollectedInfo*>::iterator it_cltd = m_gcColtedInfoMap->find(locatn); if (it_cltd != m_gcColtedInfoMap->end()) { vector<ObjectID>::iterator findIter = find(it_cltd->second->m_gcCollectedlist2->begin(), it_cltd->second->m_gcCollectedlist2->end(), objectID); if (findIter != it_cltd->second->m_gcCollectedlist2->end()) {} } 

我在我的callback方法中写这行代码,可能我的向量大小是50000(或多或less)。 当我试图在我的应用程序中使用此代码获取更多的时间加载,这是比正常多20秒。 有没有其他的方法来find向量或列表中的元素?

如果查找是每50000正常,那么更好的排序和使用std :: binary_search