Skip to content

Commit

Permalink
Perf: Use unordered_map instead of map in very slightly hot function.
Browse files Browse the repository at this point in the history
Incrementing an unordered_map's iterator is a bit faster.
  • Loading branch information
comex committed Sep 19, 2013
1 parent 5e53aa3 commit dd5505e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Core/VideoCommon/Src/x64DLCache.cpp
Expand Up @@ -4,7 +4,7 @@

// TODO: Handle cache-is-full condition :p

#include <map>
#include <unordered_map>

#include "Common.h"
#include "VideoCommon.h"
Expand Down Expand Up @@ -216,7 +216,7 @@ inline u64 CreateVMapId(u32 VATUSED)
return vmap_id;
}

typedef std::map<u64, CachedDisplayList> DLMap;
typedef std::unordered_map<u64, CachedDisplayList> DLMap;

struct VDlist
{
Expand All @@ -225,7 +225,7 @@ struct VDlist
u32 count;
};

typedef std::map<u64, VDlist> VDLMap;
typedef std::unordered_map<u64, VDlist> VDLMap;

static VDLMap dl_map;
static u8* dlcode_cache;
Expand Down

0 comments on commit dd5505e

Please sign in to comment.