title: Which is the fastest STL container for find?
body: <p>Alright as a preface I have a need to cache a relatively small subset of rarely modified data to avoid querying the database as frequently for performance reasons. This data is heavily used in a read-only sense as it is referenced often by a much larger set of data in other tables.</p>
  
  <p>I've written a class which will have the ability to store basically the entirety of the two tables in question in memory while listening for commit changes in conjunction with a thread safe callback mechanism for updating the cached objects.</p>
  
  <p>My current implementation has two <code>std::vectors</code> one for the elements of each table. The class provides both access to the entirety of each vector as well as convenience methods for searching for a specific element of table data via <code>std::find</code>, <code>std::find_if</code>, etc.</p>
  
  <p>Does anyone know if using <code>std::list</code>, <code>std::set</code>, or <code>std::map</code> over <code>std::vector</code> for searching would be preferable? Most of the time that is what will be requested of these containers after populating once from the database when a new connection is made.</p>
  
  <p>I'm also open to using C++0x features supported by VS2010 or Boost.</p>