Switch the GameDatabase from using a pxDictionary to a std::unordered_map.

Both implementations are about the same, which is hard to measure since we are limited in speed due to the hashing function.

Both implementations averaged ~220ms to load the full game database on my workstation.
This commit is contained in:
Ryan Houdek 2014-07-15 20:55:52 -05:00
parent 80b22ca2be
commit 2c6188b73f
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@
//#include "Common.h" //#include "Common.h"
#include "AppConfig.h" #include "AppConfig.h"
#include "Utilities/HashMap.h" #include "Utilities/HashMap.h"
#include "Utilities/SafeArray.h"
#include <unordered_map>
#include <wx/wfstream.h> #include <wx/wfstream.h>
struct key_pair; struct key_pair;
@ -176,7 +176,7 @@ public:
virtual void updateGame(const Game_Data& game)=0; virtual void updateGame(const Game_Data& game)=0;
}; };
typedef pxDictionary<Game_Data*,StringHashNoCase> GameDataHash; typedef std::unordered_map<wxString, Game_Data*, StringHashNoCase> GameDataHash;
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// BaseGameDatabaseImpl // BaseGameDatabaseImpl