Use flat hash map for string map.

This commit is contained in:
Bartosz Taudul 2018-03-23 21:12:29 +01:00
parent 69b49f527d
commit 6cb2fec48e
2 changed files with 8 additions and 1 deletions

View File

@ -5,6 +5,8 @@
#include <stdint.h>
#include <string.h>
#include "tracy_flat_hash_map.hpp"
namespace tracy
{
namespace charutil
@ -46,6 +48,11 @@ struct Hasher
}
};
struct HasherPOT : public Hasher
{
typedef tracy::power_of_two_hash_policy hash_policy;
};
struct Comparator
{
bool operator()( const char* lhs, const char* rhs ) const

View File

@ -58,7 +58,7 @@ class Worker
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings;
Vector<const char*> stringData;
std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> stringMap;
flat_hash_map<const char*, uint32_t, charutil::HasherPOT, charutil::Comparator> stringMap;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> threadNames;
flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation;