From 6cb2fec48ecb9ec50c3b164c75a3552235948e3a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 23 Mar 2018 21:12:29 +0100 Subject: [PATCH] Use flat hash map for string map. --- server/TracyCharUtil.hpp | 7 +++++++ server/TracyWorker.hpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/TracyCharUtil.hpp b/server/TracyCharUtil.hpp index 8e1be47d..8dd777fd 100644 --- a/server/TracyCharUtil.hpp +++ b/server/TracyCharUtil.hpp @@ -5,6 +5,8 @@ #include #include +#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 diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 503785da..a00792ef 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -58,7 +58,7 @@ class Worker flat_hash_map> strings; Vector stringData; - std::unordered_map stringMap; + flat_hash_map stringMap; flat_hash_map> threadNames; flat_hash_map> sourceLocation;