1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Use Martin Ankerl's robin hood unordered map.

ska::flat_hash_map has bugs and its development is dead.
This commit is contained in:
Bartosz Taudul 2020-01-28 21:49:36 +01:00
parent ac9479aa3f
commit 022528bb47
20 changed files with 2290 additions and 1579 deletions

View File

@ -165,7 +165,6 @@
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" /> <ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
<ClInclude Include="..\..\..\server\TracyVector.hpp" /> <ClInclude Include="..\..\..\server\TracyVector.hpp" />
<ClInclude Include="..\..\..\server\TracyWorker.hpp" /> <ClInclude Include="..\..\..\server\TracyWorker.hpp" />
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp" />
<ClInclude Include="..\..\src\getopt.h" /> <ClInclude Include="..\..\src\getopt.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -71,9 +71,6 @@
<ClInclude Include="..\..\..\common\TracySystem.hpp"> <ClInclude Include="..\..\..\common\TracySystem.hpp">
<Filter>common</Filter> <Filter>common</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp"> <ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
<Filter>server</Filter> <Filter>server</Filter>
</ClInclude> </ClInclude>

View File

@ -162,7 +162,6 @@
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" /> <ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
<ClInclude Include="..\..\..\server\TracyVector.hpp" /> <ClInclude Include="..\..\..\server\TracyVector.hpp" />
<ClInclude Include="..\..\..\server\TracyWorker.hpp" /> <ClInclude Include="..\..\..\server\TracyWorker.hpp" />
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@ -65,9 +65,6 @@
<ClInclude Include="..\..\..\common\TracySystem.hpp"> <ClInclude Include="..\..\..\common\TracySystem.hpp">
<Filter>common</Filter> <Filter>common</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp"> <ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
<Filter>server</Filter> <Filter>server</Filter>
</ClInclude> </ClInclude>

View File

@ -186,8 +186,8 @@
<ClInclude Include="..\..\..\server\TracyViewData.hpp" /> <ClInclude Include="..\..\..\server\TracyViewData.hpp" />
<ClInclude Include="..\..\..\server\TracyWorker.hpp" /> <ClInclude Include="..\..\..\server\TracyWorker.hpp" />
<ClInclude Include="..\..\..\server\TracyYield.hpp" /> <ClInclude Include="..\..\..\server\TracyYield.hpp" />
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp" />
<ClInclude Include="..\..\..\server\tracy_pdqsort.h" /> <ClInclude Include="..\..\..\server\tracy_pdqsort.h" />
<ClInclude Include="..\..\..\server\tracy_robin_hood.h" />
<ClInclude Include="..\..\..\server\tracy_xxh3.h" /> <ClInclude Include="..\..\..\server\tracy_xxh3.h" />
<ClInclude Include="..\..\libs\gl3w\GL\gl3w.h" /> <ClInclude Include="..\..\libs\gl3w\GL\gl3w.h" />
<ClInclude Include="..\..\libs\gl3w\GL\glcorearb.h" /> <ClInclude Include="..\..\libs\gl3w\GL\glcorearb.h" />

View File

@ -173,9 +173,6 @@
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp"> <ClInclude Include="..\..\..\server\TracyPopcnt.hpp">
<Filter>server</Filter> <Filter>server</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyForceInline.hpp"> <ClInclude Include="..\..\..\common\TracyForceInline.hpp">
<Filter>common</Filter> <Filter>common</Filter>
</ClInclude> </ClInclude>
@ -308,6 +305,9 @@
<ClInclude Include="..\..\..\server\TracySort.hpp"> <ClInclude Include="..\..\..\server\TracySort.hpp">
<Filter>server</Filter> <Filter>server</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\server\tracy_robin_hood.h">
<Filter>server</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Natvis Include="DebugVis.natvis" /> <Natvis Include="DebugVis.natvis" />

View File

@ -28,8 +28,8 @@
#include "stb_image.h" #include "stb_image.h"
#include "../../common/TracyProtocol.hpp" #include "../../common/TracyProtocol.hpp"
#include "../../server/tracy_flat_hash_map.hpp"
#include "../../server/tracy_pdqsort.h" #include "../../server/tracy_pdqsort.h"
#include "../../server/tracy_robin_hood.h"
#include "../../server/TracyBadVersion.hpp" #include "../../server/TracyBadVersion.hpp"
#include "../../server/TracyFileRead.hpp" #include "../../server/TracyFileRead.hpp"
#include "../../server/TracyImGui.hpp" #include "../../server/TracyImGui.hpp"
@ -105,7 +105,7 @@ struct ClientData
enum class ViewShutdown { False, True, Join }; enum class ViewShutdown { False, True, Join };
static tracy::flat_hash_map<uint32_t, ClientData> clients; static tracy::unordered_flat_map<uint32_t, ClientData> clients;
static std::unique_ptr<tracy::View> view; static std::unique_ptr<tracy::View> view;
static tracy::BadVersionState badVer; static tracy::BadVersionState badVer;
static int port = 8086; static int port = 8086;
@ -114,7 +114,7 @@ static char title[128];
static std::thread loadThread; static std::thread loadThread;
static std::unique_ptr<tracy::UdpListen> broadcastListen; static std::unique_ptr<tracy::UdpListen> broadcastListen;
static std::mutex resolvLock; static std::mutex resolvLock;
static tracy::flat_hash_map<std::string, std::string> resolvMap; static tracy::unordered_flat_map<std::string, std::string> resolvMap;
static ResolvService resolv( port ); static ResolvService resolv( port );
static ImFont* bigFont; static ImFont* bigFont;
static ImFont* smallFont; static ImFont* smallFont;

View File

@ -7,7 +7,6 @@
#define XXH_STATIC_LINKING_ONLY #define XXH_STATIC_LINKING_ONLY
#include "tracy_xxh3.h" #include "tracy_xxh3.h"
#include "tracy_flat_hash_map.hpp"
namespace tracy namespace tracy
{ {
@ -33,11 +32,6 @@ 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
@ -67,11 +61,6 @@ struct StringKey
} }
}; };
struct HasherPOT : public Hasher
{
typedef tracy::power_of_two_hash_policy hash_policy;
};
struct Comparator struct Comparator
{ {
bool operator()( const StringKey& lhs, const StringKey& rhs ) const bool operator()( const StringKey& lhs, const StringKey& rhs ) const

View File

@ -10,7 +10,7 @@
#include "TracyCharUtil.hpp" #include "TracyCharUtil.hpp"
#include "TracyShortPtr.hpp" #include "TracyShortPtr.hpp"
#include "TracyVector.hpp" #include "TracyVector.hpp"
#include "tracy_flat_hash_map.hpp" #include "tracy_robin_hood.h"
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
namespace tracy namespace tracy
@ -323,11 +323,13 @@ enum { CallstackFrameIdSize = sizeof( CallstackFrameId ) };
struct CallstackFrameTree struct CallstackFrameTree
{ {
CallstackFrameTree( CallstackFrameId id ) : frame( id ) {}
CallstackFrameId frame; CallstackFrameId frame;
uint64_t alloc; uint64_t alloc;
uint32_t count; uint32_t count;
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> children; unordered_flat_map<uint64_t, CallstackFrameTree> children;
flat_hash_set<uint32_t, nohash<uint32_t>> callstacks; unordered_flat_set<uint32_t> callstacks;
}; };
enum { CallstackFrameTreeSize = sizeof( CallstackFrameTree ) }; enum { CallstackFrameTreeSize = sizeof( CallstackFrameTree ) };
@ -464,7 +466,7 @@ struct GpuCtxData
uint64_t count; uint64_t count;
uint8_t accuracyBits; uint8_t accuracyBits;
float period; float period;
flat_hash_map<uint64_t, GpuCtxThreadData, nohash<uint64_t>> threadData; unordered_flat_map<uint64_t, GpuCtxThreadData> threadData;
short_ptr<GpuEvent> query[64*1024]; short_ptr<GpuEvent> query[64*1024];
}; };
@ -480,7 +482,7 @@ struct LockMap
int16_t srcloc; int16_t srcloc;
Vector<LockEventPtr> timeline; Vector<LockEventPtr> timeline;
flat_hash_map<uint64_t, uint8_t, nohash<uint64_t>> threadMap; unordered_flat_map<uint64_t, uint8_t> threadMap;
std::vector<uint64_t> threadList; std::vector<uint64_t> threadList;
LockType type; LockType type;
int64_t timeAnnounce; int64_t timeAnnounce;
@ -530,7 +532,7 @@ struct MemData
{ {
Vector<MemEvent> data; Vector<MemEvent> data;
Vector<uint32_t> frees; Vector<uint32_t> frees;
flat_hash_map<uint64_t, size_t, nohash<uint64_t>> active; unordered_flat_map<uint64_t, size_t> active;
uint64_t high = std::numeric_limits<uint64_t>::min(); uint64_t high = std::numeric_limits<uint64_t>::min();
uint64_t low = std::numeric_limits<uint64_t>::max(); uint64_t low = std::numeric_limits<uint64_t>::max();
uint64_t usage = 0; uint64_t usage = 0;
@ -561,7 +563,6 @@ struct SourceLocationHasher
{ {
return charutil::hash( (const char*)ptr, sizeof( SourceLocationBase ) ); return charutil::hash( (const char*)ptr, sizeof( SourceLocationBase ) );
} }
typedef tracy::power_of_two_hash_policy hash_policy;
}; };
struct SourceLocationComparator struct SourceLocationComparator

View File

@ -2,7 +2,7 @@
#define __TRACYSTRINGDISCOVERY_HPP__ #define __TRACYSTRINGDISCOVERY_HPP__
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
#include "tracy_flat_hash_map.hpp" #include "tracy_robin_hood.h"
#include "TracyCharUtil.hpp" #include "TracyCharUtil.hpp"
#include "TracyVector.hpp" #include "TracyVector.hpp"
@ -69,9 +69,9 @@ public:
private: private:
Vector<T> m_data; Vector<T> m_data;
flat_hash_map<uint64_t, T, nohash<uint64_t>> m_pending; unordered_flat_map<uint64_t, T> m_pending;
flat_hash_map<uint64_t, T, nohash<uint64_t>> m_map; unordered_flat_map<uint64_t, T> m_map;
flat_hash_map<const char*, T, charutil::HasherPOT, charutil::Comparator> m_rev; unordered_flat_map<const char*, T, charutil::Hasher, charutil::Comparator> m_rev;
}; };
} }

View File

@ -5,7 +5,7 @@
#include <stdint.h> #include <stdint.h>
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
#include "tracy_flat_hash_map.hpp" #include "tracy_robin_hood.h"
#include "TracyVector.hpp" #include "TracyVector.hpp"
namespace tracy namespace tracy
@ -51,7 +51,7 @@ private:
uint16_t CompressThreadReal( uint64_t thread ); uint16_t CompressThreadReal( uint64_t thread );
uint16_t CompressThreadNew( uint64_t thread ); uint16_t CompressThreadNew( uint64_t thread );
flat_hash_map<uint64_t, uint16_t, nohash<uint64_t>> m_threadMap; unordered_flat_map<uint64_t, uint16_t> m_threadMap;
Vector<uint64_t> m_threadExpand; Vector<uint64_t> m_threadExpand;
std::pair<uint64_t, uint16_t> m_threadLast; std::pair<uint64_t, uint16_t> m_threadLast;
}; };

View File

@ -5,7 +5,6 @@
#include <string.h> #include <string.h>
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
#include "tracy_flat_hash_map.hpp"
#include "TracyCharUtil.hpp" #include "TracyCharUtil.hpp"
#include "TracyEvent.hpp" #include "TracyEvent.hpp"
#include "TracyMemory.hpp" #include "TracyMemory.hpp"
@ -97,12 +96,6 @@ struct VarArrayHasher
} }
}; };
template<typename T>
struct VarArrayHasherPOT : public VarArrayHasher<T>
{
typedef tracy::power_of_two_hash_policy hash_policy;
};
template<typename T> template<typename T>
struct VarArrayComparator struct VarArrayComparator
{ {

View File

@ -5607,7 +5607,7 @@ void DrawZoneTrace( T zone, const std::vector<T>& trace, const Worker& worker, B
ImGui::TreePop(); ImGui::TreePop();
} }
void View::CalcZoneTimeData( flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ) void View::CalcZoneTimeData( unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone )
{ {
assert( zone.HasChildren() ); assert( zone.HasChildren() );
const auto& children = m_worker.GetZoneChildren( zone.Child() ); const auto& children = m_worker.GetZoneChildren( zone.Child() );
@ -5622,7 +5622,7 @@ void View::CalcZoneTimeData( flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_
} }
template<typename Adapter, typename V> template<typename Adapter, typename V>
void View::CalcZoneTimeDataImpl( const V& children, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ) void View::CalcZoneTimeDataImpl( const V& children, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone )
{ {
Adapter a; Adapter a;
if( m_timeDist.exclusiveTime ) if( m_timeDist.exclusiveTime )
@ -5651,7 +5651,7 @@ void View::CalcZoneTimeDataImpl( const V& children, flat_hash_map<int16_t, ZoneT
} }
} }
void View::CalcZoneTimeData( const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ) void View::CalcZoneTimeData( const ContextSwitch* ctx, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone )
{ {
assert( zone.HasChildren() ); assert( zone.HasChildren() );
const auto& children = m_worker.GetZoneChildren( zone.Child() ); const auto& children = m_worker.GetZoneChildren( zone.Child() );
@ -5666,7 +5666,7 @@ void View::CalcZoneTimeData( const ContextSwitch* ctx, flat_hash_map<int16_t, Zo
} }
template<typename Adapter, typename V> template<typename Adapter, typename V>
void View::CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ) void View::CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone )
{ {
Adapter a; Adapter a;
if( m_timeDist.exclusiveTime ) if( m_timeDist.exclusiveTime )
@ -6388,7 +6388,7 @@ void View::DrawZoneInfoWindow()
} }
if( !m_timeDist.data.empty() ) if( !m_timeDist.data.empty() )
{ {
std::vector<flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::const_iterator> vec; std::vector<unordered_flat_map<int16_t, ZoneTimeData>::const_iterator> vec;
vec.reserve( m_timeDist.data.size() ); vec.reserve( m_timeDist.data.size() );
for( auto it = m_timeDist.data.cbegin(); it != m_timeDist.data.cend(); ++it ) vec.emplace_back( it ); for( auto it = m_timeDist.data.cbegin(); it != m_timeDist.data.cend(); ++it ) vec.emplace_back( it );
static bool widthSet = false; static bool widthSet = false;
@ -6478,7 +6478,7 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
Vector<uint32_t> v; Vector<uint32_t> v;
}; };
uint64_t ctime = 0; uint64_t ctime = 0;
flat_hash_map<int16_t, ChildGroup, nohash<int16_t>> cmap; unordered_flat_map<int16_t, ChildGroup> cmap;
cmap.reserve( 128 ); cmap.reserve( 128 );
for( size_t i=0; i<children.size(); i++ ) for( size_t i=0; i<children.size(); i++ )
{ {
@ -6921,7 +6921,7 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
Vector<uint32_t> v; Vector<uint32_t> v;
}; };
uint64_t ctime = 0; uint64_t ctime = 0;
flat_hash_map<int16_t, ChildGroup, nohash<int16_t>> cmap; unordered_flat_map<int16_t, ChildGroup> cmap;
cmap.reserve( 128 ); cmap.reserve( 128 );
for( size_t i=0; i<children.size(); i++ ) for( size_t i=0; i<children.size(); i++ )
{ {
@ -12235,7 +12235,7 @@ void View::DrawCpuDataWindow()
}; };
const auto& ctd = m_worker.GetCpuThreadData(); const auto& ctd = m_worker.GetCpuThreadData();
flat_hash_map<uint64_t, PidData, nohash<uint64_t>> pids; unordered_flat_map<uint64_t, PidData> pids;
for( auto& v : ctd ) for( auto& v : ctd )
{ {
uint64_t pid = m_worker.GetPidFromTid( v.first ); uint64_t pid = m_worker.GetPidFromTid( v.first );
@ -12270,7 +12270,7 @@ void View::DrawCpuDataWindow()
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Separator(); ImGui::Separator();
std::vector<flat_hash_map<uint64_t, PidData, nohash<uint64_t>>::iterator> psort; std::vector<unordered_flat_map<uint64_t, PidData>::iterator> psort;
psort.reserve( pids.size() ); psort.reserve( pids.size() );
for( auto it = pids.begin(); it != pids.end(); ++it ) psort.emplace_back( it ); for( auto it = pids.begin(); it != pids.end(); ++it ) psort.emplace_back( it );
switch( m_cpuDataSort ) switch( m_cpuDataSort )
@ -12763,17 +12763,17 @@ void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const
ImGui::EndChild(); ImGui::EndChild();
} }
static tracy_force_inline CallstackFrameTree* GetFrameTreeItemNoGroup( flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>>& tree, CallstackFrameId idx, const Worker& worker ) static tracy_force_inline CallstackFrameTree* GetFrameTreeItemNoGroup( unordered_flat_map<uint64_t, CallstackFrameTree>& tree, CallstackFrameId idx, const Worker& worker )
{ {
auto it = tree.find( idx.data ); auto it = tree.find( idx.data );
if( it == tree.end() ) if( it == tree.end() )
{ {
it = tree.emplace( idx.data, CallstackFrameTree { idx } ).first; it = tree.emplace( idx.data, CallstackFrameTree( idx ) ).first;
} }
return &it->second; return &it->second;
} }
static tracy_force_inline CallstackFrameTree* GetFrameTreeItemGroup( flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>>& tree, CallstackFrameId idx, const Worker& worker ) static tracy_force_inline CallstackFrameTree* GetFrameTreeItemGroup( unordered_flat_map<uint64_t, CallstackFrameTree>& tree, CallstackFrameId idx, const Worker& worker )
{ {
auto frameDataPtr = worker.GetCallstackFrame( idx ); auto frameDataPtr = worker.GetCallstackFrame( idx );
if( !frameDataPtr ) return nullptr; if( !frameDataPtr ) return nullptr;
@ -12785,14 +12785,14 @@ static tracy_force_inline CallstackFrameTree* GetFrameTreeItemGroup( flat_hash_m
auto it = tree.find( fidx ); auto it = tree.find( fidx );
if( it == tree.end() ) if( it == tree.end() )
{ {
it = tree.emplace( fidx, CallstackFrameTree { idx } ).first; it = tree.emplace( fidx, CallstackFrameTree( idx ) ).first;
} }
return &it->second; return &it->second;
} }
flat_hash_map<uint32_t, View::PathData, nohash<uint32_t>> View::GetCallstackPaths( const MemData& mem, bool onlyActive ) const unordered_flat_map<uint32_t, View::PathData> View::GetCallstackPaths( const MemData& mem, bool onlyActive ) const
{ {
flat_hash_map<uint32_t, PathData, nohash<uint32_t>> pathSum; unordered_flat_map<uint32_t, PathData> pathSum;
pathSum.reserve( m_worker.GetCallstackPayloadCount() ); pathSum.reserve( m_worker.GetCallstackPayloadCount() );
const auto zvMid = m_vd.zvStart + ( m_vd.zvEnd - m_vd.zvStart ) / 2; const auto zvMid = m_vd.zvStart + ( m_vd.zvEnd - m_vd.zvStart ) / 2;
@ -12839,9 +12839,9 @@ flat_hash_map<uint32_t, View::PathData, nohash<uint32_t>> View::GetCallstackPath
return pathSum; return pathSum;
} }
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> View::GetCallstackFrameTreeBottomUp( const MemData& mem ) const unordered_flat_map<uint64_t, CallstackFrameTree> View::GetCallstackFrameTreeBottomUp( const MemData& mem ) const
{ {
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> root; unordered_flat_map<uint64_t, CallstackFrameTree> root;
auto pathSum = GetCallstackPaths( mem, m_activeOnlyBottomUp ); auto pathSum = GetCallstackPaths( mem, m_activeOnlyBottomUp );
if( m_groupCallstackTreeByNameBottomUp ) if( m_groupCallstackTreeByNameBottomUp )
{ {
@ -12892,9 +12892,9 @@ flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> View::GetCallstack
return root; return root;
} }
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> View::GetCallstackFrameTreeTopDown( const MemData& mem ) const unordered_flat_map<uint64_t, CallstackFrameTree> View::GetCallstackFrameTreeTopDown( const MemData& mem ) const
{ {
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> root; unordered_flat_map<uint64_t, CallstackFrameTree> root;
auto pathSum = GetCallstackPaths( mem, m_activeOnlyTopDown ); auto pathSum = GetCallstackPaths( mem, m_activeOnlyTopDown );
if( m_groupCallstackTreeByNameTopDown ) if( m_groupCallstackTreeByNameTopDown )
{ {
@ -12993,7 +12993,7 @@ struct MemoryPage
int8_t data[PageSize]; int8_t data[PageSize];
}; };
static tracy_force_inline MemoryPage& GetPage( flat_hash_map<uint64_t, MemoryPage, nohash<uint64_t>>& memmap, uint64_t page ) static tracy_force_inline MemoryPage& GetPage( unordered_flat_map<uint64_t, MemoryPage>& memmap, uint64_t page )
{ {
auto it = memmap.find( page ); auto it = memmap.find( page );
if( it == memmap.end() ) if( it == memmap.end() )
@ -13003,7 +13003,7 @@ static tracy_force_inline MemoryPage& GetPage( flat_hash_map<uint64_t, MemoryPag
return it->second; return it->second;
} }
static tracy_force_inline void FillPages( flat_hash_map<uint64_t, MemoryPage, nohash<uint64_t>>& memmap, uint64_t c0, uint64_t c1, int8_t val ) static tracy_force_inline void FillPages( unordered_flat_map<uint64_t, MemoryPage>& memmap, uint64_t c0, uint64_t c1, int8_t val )
{ {
auto p0 = c0 >> PageBits; auto p0 = c0 >> PageBits;
const auto p1 = c1 >> PageBits; const auto p1 = c1 >> PageBits;
@ -13047,7 +13047,7 @@ std::vector<MemoryPage> View::GetMemoryPages() const
{ {
std::vector<MemoryPage> ret; std::vector<MemoryPage> ret;
static flat_hash_map<uint64_t, MemoryPage, nohash<uint64_t>> memmap; static unordered_flat_map<uint64_t, MemoryPage> memmap;
const auto& mem = m_worker.GetMemData(); const auto& mem = m_worker.GetMemData();
const auto memlow = mem.low; const auto memlow = mem.low;
@ -13092,7 +13092,7 @@ std::vector<MemoryPage> View::GetMemoryPages() const
} }
} }
std::vector<flat_hash_map<uint64_t, MemoryPage, nohash<uint64_t>>::const_iterator> itmap; std::vector<unordered_flat_map<uint64_t, MemoryPage>::const_iterator> itmap;
itmap.reserve( memmap.size() ); itmap.reserve( memmap.size() );
ret.reserve( memmap.size() ); ret.reserve( memmap.size() );
for( auto it = memmap.begin(); it != memmap.end(); ++it ) itmap.emplace_back( it ); for( auto it = memmap.begin(); it != memmap.end(); ++it ) itmap.emplace_back( it );
@ -13407,11 +13407,11 @@ void View::DrawMemory()
ImGui::End(); ImGui::End();
} }
void View::DrawFrameTreeLevel( const flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>>& tree, int& idx ) void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrameTree>& tree, int& idx )
{ {
auto& io = ImGui::GetIO(); auto& io = ImGui::GetIO();
std::vector<flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>>::const_iterator> sorted; std::vector<unordered_flat_map<uint64_t, CallstackFrameTree>::const_iterator> sorted;
sorted.reserve( tree.size() ); sorted.reserve( tree.size() );
for( auto it = tree.begin(); it != tree.end(); ++it ) for( auto it = tree.begin(); it != tree.end(); ++it )
{ {

View File

@ -17,7 +17,7 @@
#include "TracyVector.hpp" #include "TracyVector.hpp"
#include "TracyViewData.hpp" #include "TracyViewData.hpp"
#include "TracyWorker.hpp" #include "TracyWorker.hpp"
#include "tracy_flat_hash_map.hpp" #include "tracy_robin_hood.h"
struct ImVec2; struct ImVec2;
struct ImFont; struct ImFont;
@ -156,10 +156,10 @@ private:
template<class T> template<class T>
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr, int64_t startTime = -1 ); void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr, int64_t startTime = -1 );
flat_hash_map<uint32_t, PathData, nohash<uint32_t>> GetCallstackPaths( const MemData& mem, bool onlyActive ) const; unordered_flat_map<uint32_t, PathData> GetCallstackPaths( const MemData& mem, bool onlyActive ) const;
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> GetCallstackFrameTreeBottomUp( const MemData& mem ) const; unordered_flat_map<uint64_t, CallstackFrameTree> GetCallstackFrameTreeBottomUp( const MemData& mem ) const;
flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>> GetCallstackFrameTreeTopDown( const MemData& mem ) const; unordered_flat_map<uint64_t, CallstackFrameTree> GetCallstackFrameTreeTopDown( const MemData& mem ) const;
void DrawFrameTreeLevel( const flat_hash_map<uint64_t, CallstackFrameTree, nohash<uint64_t>>& tree, int& idx ); void DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrameTree>& tree, int& idx );
void DrawZoneList( const Vector<short_ptr<ZoneEvent>>& zones ); void DrawZoneList( const Vector<short_ptr<ZoneEvent>>& zones );
void DrawInfoWindow(); void DrawInfoWindow();
@ -231,19 +231,19 @@ private:
int64_t GetZoneSelfTime( const GpuEvent& zone ); int64_t GetZoneSelfTime( const GpuEvent& zone );
bool GetZoneRunningTime( const ContextSwitch* ctx, const ZoneEvent& ev, int64_t& time, uint64_t& cnt ); bool GetZoneRunningTime( const ContextSwitch* ctx, const ZoneEvent& ev, int64_t& time, uint64_t& cnt );
tracy_force_inline void CalcZoneTimeData( flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ); tracy_force_inline void CalcZoneTimeData( unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone );
tracy_force_inline void CalcZoneTimeData( const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ); tracy_force_inline void CalcZoneTimeData( const ContextSwitch* ctx, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone );
template<typename Adapter, typename V> template<typename Adapter, typename V>
void CalcZoneTimeDataImpl( const V& children, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ); void CalcZoneTimeDataImpl( const V& children, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone );
template<typename Adapter, typename V> template<typename Adapter, typename V>
void CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>& data, flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>>::iterator zit, const ZoneEvent& zone ); void CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, unordered_flat_map<int16_t, ZoneTimeData>& data, unordered_flat_map<int16_t, ZoneTimeData>::iterator zit, const ZoneEvent& zone );
void SetPlaybackFrame( uint32_t idx ); void SetPlaybackFrame( uint32_t idx );
flat_hash_map<const void*, VisData, nohash<const void*>> m_visData; unordered_flat_map<const void*, VisData> m_visData;
flat_hash_map<uint64_t, bool, nohash<uint64_t>> m_visibleMsgThread; unordered_flat_map<uint64_t, bool> m_visibleMsgThread;
flat_hash_map<const void*, int, nohash<const void*>> m_gpuDrift; unordered_flat_map<const void*, int> m_gpuDrift;
flat_hash_map<const PlotData*, PlotView, nohash<const PlotData*>> m_plotView; unordered_flat_map<const PlotData*, PlotView> m_plotView;
Vector<const ThreadData*> m_threadOrder; Vector<const ThreadData*> m_threadOrder;
Vector<float> m_threadDnd; Vector<float> m_threadDnd;
@ -415,7 +415,7 @@ private:
bool show = false; bool show = false;
bool ignoreCase = false; bool ignoreCase = false;
std::vector<int16_t> match; std::vector<int16_t> match;
flat_hash_map<uint64_t, Group, nohash<uint64_t>> groups; unordered_flat_map<uint64_t, Group> groups;
size_t processed; size_t processed;
uint16_t groupId; uint16_t groupId;
int selMatch = 0; int selMatch = 0;
@ -626,7 +626,7 @@ private:
SortBy sortBy = SortBy::Time; SortBy sortBy = SortBy::Time;
bool runningTime = false; bool runningTime = false;
bool exclusiveTime = true; bool exclusiveTime = true;
flat_hash_map<int16_t, ZoneTimeData, nohash<uint16_t>> data; unordered_flat_map<int16_t, ZoneTimeData> data;
const ZoneEvent* dataValidFor = nullptr; const ZoneEvent* dataValidFor = nullptr;
float fztime; float fztime;
} m_timeDist; } m_timeDist;

View File

@ -23,8 +23,6 @@
#include "TracyWorker.hpp" #include "TracyWorker.hpp"
#include "TracyYield.hpp" #include "TracyYield.hpp"
#include "tracy_flat_hash_map.hpp"
namespace tracy namespace tracy
{ {
@ -465,7 +463,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
uint32_t packageId; uint32_t packageId;
uint64_t psz; uint64_t psz;
f.Read2( packageId, psz ); f.Read2( packageId, psz );
auto& package = *m_data.cpuTopology.emplace( packageId, flat_hash_map<uint32_t, std::vector<uint32_t>> {} ).first; auto& package = *m_data.cpuTopology.emplace( packageId, unordered_flat_map<uint32_t, std::vector<uint32_t>> {} ).first;
package.second.reserve( psz ); package.second.reserve( psz );
for( uint64_t j=0; j<psz; j++ ) for( uint64_t j=0; j<psz; j++ )
{ {
@ -556,7 +554,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
} }
} }
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> pointerMap; unordered_flat_map<uint64_t, const char*> pointerMap;
f.Read( sz ); f.Read( sz );
m_data.stringData.reserve_exact( sz, m_slab ); m_data.stringData.reserve_exact( sz, m_slab );
@ -850,7 +848,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
s_loadProgress.subTotal.store( 0, std::memory_order_relaxed ); s_loadProgress.subTotal.store( 0, std::memory_order_relaxed );
s_loadProgress.progress.store( LoadProgress::Messages, std::memory_order_relaxed ); s_loadProgress.progress.store( LoadProgress::Messages, std::memory_order_relaxed );
flat_hash_map<uint64_t, MessageData*, nohash<uint64_t>> msgMap; unordered_flat_map<uint64_t, MessageData*> msgMap;
f.Read( sz ); f.Read( sz );
if( eventMask & EventType::Messages ) if( eventMask & EventType::Messages )
{ {
@ -4769,7 +4767,7 @@ void Worker::ProcessParamSetup( const QueueParamSetup& ev )
void Worker::ProcessCpuTopology( const QueueCpuTopology& ev ) void Worker::ProcessCpuTopology( const QueueCpuTopology& ev )
{ {
auto package = m_data.cpuTopology.find( ev.package ); auto package = m_data.cpuTopology.find( ev.package );
if( package == m_data.cpuTopology.end() ) package = m_data.cpuTopology.emplace( ev.package, flat_hash_map<uint32_t, std::vector<uint32_t>> {} ).first; if( package == m_data.cpuTopology.end() ) package = m_data.cpuTopology.emplace( ev.package, unordered_flat_map<uint32_t, std::vector<uint32_t>> {} ).first;
auto core = package->second.find( ev.core ); auto core = package->second.find( ev.core );
if( core == package->second.end() ) core = package->second.emplace( ev.core, std::vector<uint32_t> {} ).first; if( core == package->second.end() ) core = package->second.emplace( ev.core, std::vector<uint32_t> {} ).first;
core->second.emplace_back( ev.thread ); core->second.emplace_back( ev.thread );
@ -5699,7 +5697,7 @@ void Worker::Write( FileWrite& f )
} }
// Only save context switches relevant to active threads. // Only save context switches relevant to active threads.
std::vector<flat_hash_map<uint64_t, ContextSwitch*, nohash<uint64_t>>::const_iterator> ctxValid; std::vector<unordered_flat_map<uint64_t, ContextSwitch*>::const_iterator> ctxValid;
ctxValid.reserve( m_data.ctxSwitch.size() ); ctxValid.reserve( m_data.ctxSwitch.size() );
for( auto it = m_data.ctxSwitch.begin(); it != m_data.ctxSwitch.end(); ++it ) for( auto it = m_data.ctxSwitch.begin(); it != m_data.ctxSwitch.end(); ++it )
{ {

View File

@ -16,7 +16,7 @@
#include "../common/TracyQueue.hpp" #include "../common/TracyQueue.hpp"
#include "../common/TracyProtocol.hpp" #include "../common/TracyProtocol.hpp"
#include "../common/TracySocket.hpp" #include "../common/TracySocket.hpp"
#include "tracy_flat_hash_map.hpp" #include "tracy_robin_hood.h"
#include "TracyEvent.hpp" #include "TracyEvent.hpp"
#include "TracyShortPtr.hpp" #include "TracyShortPtr.hpp"
#include "TracySlab.hpp" #include "TracySlab.hpp"
@ -137,7 +137,6 @@ private:
struct CallstackFrameIdHash struct CallstackFrameIdHash
{ {
size_t operator()( const CallstackFrameId& id ) const { return id.data; } size_t operator()( const CallstackFrameId& id ) const { return id.data; }
typedef tracy::power_of_two_hash_policy hash_policy;
}; };
struct CallstackFrameIdCompare struct CallstackFrameIdCompare
@ -159,7 +158,6 @@ private:
} }
return hash; return hash;
} }
typedef tracy::power_of_two_hash_policy hash_policy;
}; };
struct RevFrameComp struct RevFrameComp
@ -192,29 +190,29 @@ private:
int64_t lastTime = 0; int64_t lastTime = 0;
uint64_t frameOffset = 0; uint64_t frameOffset = 0;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings; unordered_flat_map<uint64_t, const char*> strings;
Vector<const char*> stringData; Vector<const char*> stringData;
flat_hash_map<charutil::StringKey, uint32_t, charutil::StringKey::HasherPOT, charutil::StringKey::Comparator> stringMap; unordered_flat_map<charutil::StringKey, uint32_t, charutil::StringKey::Hasher, charutil::StringKey::Comparator> stringMap;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> threadNames; unordered_flat_map<uint64_t, const char*> threadNames;
flat_hash_map<uint64_t, std::pair<const char*, const char*>, nohash<uint64_t>> externalNames; unordered_flat_map<uint64_t, std::pair<const char*, const char*>> externalNames;
flat_hash_map<uint64_t, SourceLocation, nohash<uint64_t>> sourceLocation; unordered_flat_map<uint64_t, SourceLocation> sourceLocation;
Vector<short_ptr<SourceLocation>> sourceLocationPayload; Vector<short_ptr<SourceLocation>> sourceLocationPayload;
flat_hash_map<const SourceLocation*, int16_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap; unordered_flat_map<const SourceLocation*, int16_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap;
Vector<uint64_t> sourceLocationExpand; Vector<uint64_t> sourceLocationExpand;
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
flat_hash_map<int16_t, SourceLocationZones, nohash<int16_t>> sourceLocationZones; unordered_flat_map<int16_t, SourceLocationZones> sourceLocationZones;
bool sourceLocationZonesReady; bool sourceLocationZonesReady;
#else #else
flat_hash_map<int16_t, uint64_t> sourceLocationZonesCnt; unordered_flat_map<int16_t, uint64_t> sourceLocationZonesCnt;
#endif #endif
flat_hash_map<VarArray<CallstackFrameId>*, uint32_t, VarArrayHasherPOT<CallstackFrameId>, VarArrayComparator<CallstackFrameId>> callstackMap; unordered_flat_map<VarArray<CallstackFrameId>*, uint32_t, VarArrayHasher<CallstackFrameId>, VarArrayComparator<CallstackFrameId>> callstackMap;
Vector<short_ptr<VarArray<CallstackFrameId>>> callstackPayload; Vector<short_ptr<VarArray<CallstackFrameId>>> callstackPayload;
flat_hash_map<CallstackFrameId, CallstackFrameData*, CallstackFrameIdHash, CallstackFrameIdCompare> callstackFrameMap; unordered_flat_map<CallstackFrameId, CallstackFrameData*, CallstackFrameIdHash, CallstackFrameIdCompare> callstackFrameMap;
flat_hash_map<CallstackFrameData*, CallstackFrameId, RevFrameHash, RevFrameComp> revFrameMap; unordered_flat_map<CallstackFrameData*, CallstackFrameId, RevFrameHash, RevFrameComp> revFrameMap;
flat_hash_map<uint32_t, LockMap*, nohash<uint32_t>> lockMap; unordered_flat_map<uint32_t, LockMap*> lockMap;
ThreadCompress localThreadCompress; ThreadCompress localThreadCompress;
ThreadCompress externalThreadCompress; ThreadCompress externalThreadCompress;
@ -229,12 +227,12 @@ private:
CrashEvent crashEvent; CrashEvent crashEvent;
flat_hash_map<uint64_t, ContextSwitch*, nohash<uint64_t>> ctxSwitch; unordered_flat_map<uint64_t, ContextSwitch*> ctxSwitch;
CpuData cpuData[256]; CpuData cpuData[256];
int cpuDataCount = 0; int cpuDataCount = 0;
flat_hash_map<uint64_t, uint64_t, nohash<uint64_t>> tidToPid; unordered_flat_map<uint64_t, uint64_t> tidToPid;
flat_hash_map<uint64_t, CpuThreadData, nohash<uint64_t>> cpuThreadData; unordered_flat_map<uint64_t, CpuThreadData> cpuThreadData;
std::pair<uint64_t, ThreadData*> threadDataLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr ); std::pair<uint64_t, ThreadData*> threadDataLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr );
std::pair<uint64_t, ContextSwitch*> ctxSwitchLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr ); std::pair<uint64_t, ContextSwitch*> ctxSwitchLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr );
@ -251,8 +249,8 @@ private:
bool ctxUsageReady = false; bool ctxUsageReady = false;
#endif #endif
flat_hash_map<uint32_t, flat_hash_map<uint32_t, std::vector<uint32_t>>> cpuTopology; unordered_flat_map<uint32_t, unordered_flat_map<uint32_t, std::vector<uint32_t>>> cpuTopology;
flat_hash_map<uint32_t, CpuThreadTopology, nohash<uint32_t>> cpuTopologyMap; unordered_flat_map<uint32_t, CpuThreadTopology> cpuTopologyMap;
}; };
struct MbpsBlock struct MbpsBlock
@ -353,7 +351,7 @@ public:
const CpuData* GetCpuData() const { return m_data.cpuData; } const CpuData* GetCpuData() const { return m_data.cpuData; }
int GetCpuDataCpuCount() const { return m_data.cpuDataCount; } int GetCpuDataCpuCount() const { return m_data.cpuDataCount; }
uint64_t GetPidFromTid( uint64_t tid ) const; uint64_t GetPidFromTid( uint64_t tid ) const;
const flat_hash_map<uint64_t, CpuThreadData, nohash<uint64_t>>& GetCpuThreadData() const { return m_data.cpuThreadData; } const unordered_flat_map<uint64_t, CpuThreadData>& GetCpuThreadData() const { return m_data.cpuThreadData; }
void GetCpuUsageAtTime( int64_t time, int& own, int& other ) const; void GetCpuUsageAtTime( int64_t time, int& own, int& other ) const;
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const; int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
@ -362,7 +360,7 @@ public:
const FrameImage* GetFrameImage( const FrameData& fd, size_t idx ) const; const FrameImage* GetFrameImage( const FrameData& fd, size_t idx ) const;
std::pair<int, int> GetFrameRange( const FrameData& fd, int64_t from, int64_t to ); std::pair<int, int> GetFrameRange( const FrameData& fd, int64_t from, int64_t to );
const flat_hash_map<uint32_t, LockMap*, nohash<uint32_t>>& GetLockMap() const { return m_data.lockMap; } const unordered_flat_map<uint32_t, LockMap*>& GetLockMap() const { return m_data.lockMap; }
const Vector<short_ptr<MessageData>>& GetMessages() const { return m_data.messages; } const Vector<short_ptr<MessageData>>& GetMessages() const { return m_data.messages; }
const Vector<GpuCtxData*>& GetGpuData() const { return m_data.gpuData; } const Vector<GpuCtxData*>& GetGpuData() const { return m_data.gpuData; }
const Vector<PlotData*>& GetPlots() const { return m_data.plots.Data(); } const Vector<PlotData*>& GetPlots() const { return m_data.plots.Data(); }
@ -411,7 +409,7 @@ public:
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
const SourceLocationZones& GetZonesForSourceLocation( int16_t srcloc ) const; const SourceLocationZones& GetZonesForSourceLocation( int16_t srcloc ) const;
const flat_hash_map<int16_t, SourceLocationZones, nohash<int16_t>>& GetSourceLocationZones() const { return m_data.sourceLocationZones; } const unordered_flat_map<int16_t, SourceLocationZones>& GetSourceLocationZones() const { return m_data.sourceLocationZones; }
bool AreSourceLocationZonesReady() const { return m_data.sourceLocationZonesReady; } bool AreSourceLocationZonesReady() const { return m_data.sourceLocationZonesReady; }
bool IsCpuUsageReady() const { return m_data.ctxUsageReady; } bool IsCpuUsageReady() const { return m_data.ctxUsageReady; }
#endif #endif
@ -673,15 +671,15 @@ private:
bool m_ignoreMemFreeFaults; bool m_ignoreMemFreeFaults;
short_ptr<GpuCtxData> m_gpuCtxMap[256]; short_ptr<GpuCtxData> m_gpuCtxMap[256];
flat_hash_map<uint64_t, StringLocation, nohash<uint64_t>> m_pendingCustomStrings; unordered_flat_map<uint64_t, StringLocation> m_pendingCustomStrings;
uint64_t m_pendingCallstackPtr = 0; uint64_t m_pendingCallstackPtr = 0;
uint32_t m_pendingCallstackId; uint32_t m_pendingCallstackId;
flat_hash_map<uint64_t, int16_t, nohash<uint64_t>> m_pendingSourceLocationPayload; unordered_flat_map<uint64_t, int16_t> m_pendingSourceLocationPayload;
Vector<uint64_t> m_sourceLocationQueue; Vector<uint64_t> m_sourceLocationQueue;
flat_hash_map<uint64_t, int16_t, nohash<uint64_t>> m_sourceLocationShrink; unordered_flat_map<uint64_t, int16_t> m_sourceLocationShrink;
flat_hash_map<uint64_t, ThreadData*, nohash<uint64_t>> m_threadMap; unordered_flat_map<uint64_t, ThreadData*> m_threadMap;
flat_hash_map<uint64_t, NextCallstack, nohash<uint64_t>> m_nextCallstack; unordered_flat_map<uint64_t, NextCallstack> m_nextCallstack;
flat_hash_map<uint64_t, FrameImagePending, nohash<uint64_t>> m_pendingFrameImageData; unordered_flat_map<uint64_t, FrameImagePending> m_pendingFrameImageData;
uint32_t m_pendingStrings; uint32_t m_pendingStrings;
uint32_t m_pendingThreads; uint32_t m_pendingThreads;
@ -716,7 +714,7 @@ private:
Vector<ServerQueryPacket> m_serverQueryQueue; Vector<ServerQueryPacket> m_serverQueryQueue;
size_t m_serverQuerySpaceLeft; size_t m_serverQuerySpaceLeft;
flat_hash_map<uint64_t, int32_t> m_frameImageStaging; unordered_flat_map<uint64_t, int32_t> m_frameImageStaging;
char* m_frameImageBuffer = nullptr; char* m_frameImageBuffer = nullptr;
size_t m_frameImageBufferSize = 0; size_t m_frameImageBufferSize = 0;
char* m_frameImageCompressedBuffer = nullptr; char* m_frameImageCompressedBuffer = nullptr;

File diff suppressed because it is too large Load Diff

2194
server/tracy_robin_hood.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -162,7 +162,6 @@
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" /> <ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
<ClInclude Include="..\..\..\server\TracyVector.hpp" /> <ClInclude Include="..\..\..\server\TracyVector.hpp" />
<ClInclude Include="..\..\..\server\TracyWorker.hpp" /> <ClInclude Include="..\..\..\server\TracyWorker.hpp" />
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@ -65,9 +65,6 @@
<ClInclude Include="..\..\..\common\TracySystem.hpp"> <ClInclude Include="..\..\..\common\TracySystem.hpp">
<Filter>common</Filter> <Filter>common</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\server\tracy_flat_hash_map.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp"> <ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
<Filter>server</Filter> <Filter>server</Filter>
</ClInclude> </ClInclude>