mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Use flat hash map for string map.
This commit is contained in:
parent
69b49f527d
commit
6cb2fec48e
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user