mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +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 <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "tracy_flat_hash_map.hpp"
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
namespace charutil
|
namespace charutil
|
||||||
@ -46,6 +48,11 @@ struct Hasher
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct HasherPOT : public Hasher
|
||||||
|
{
|
||||||
|
typedef tracy::power_of_two_hash_policy hash_policy;
|
||||||
|
};
|
||||||
|
|
||||||
struct Comparator
|
struct Comparator
|
||||||
{
|
{
|
||||||
bool operator()( const char* lhs, const char* rhs ) const
|
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;
|
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings;
|
||||||
Vector<const char*> stringData;
|
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, const char*, nohash<uint64_t>> threadNames;
|
||||||
|
|
||||||
flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation;
|
flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user