mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Fix the horribly inefficient Visible() and ShowFull() methods.
This commit is contained in:
parent
ceeae3c2cf
commit
37808ec4c7
@ -103,28 +103,27 @@ private:
|
|||||||
void FindZones();
|
void FindZones();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
flat_hash_map<const void*, bool, nohash<const void*>> m_visible;
|
||||||
bool& Visible( const T* ptr )
|
flat_hash_map<const void*, bool, nohash<const void*>> m_showFull;
|
||||||
|
|
||||||
|
tracy_force_inline bool& Visible( const void* ptr )
|
||||||
{
|
{
|
||||||
static std::map <const T*, bool> visible;
|
auto it = m_visible.find( ptr );
|
||||||
if( visible.find( ptr ) == visible.end() )
|
if( it == m_visible.end() )
|
||||||
{
|
{
|
||||||
visible[ptr] = true;
|
it = m_visible.emplace( ptr, true ).first;
|
||||||
|
}
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return visible[ptr];
|
tracy_force_inline bool& ShowFull( const void* ptr )
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
bool& ShowFull( const T* ptr )
|
|
||||||
{
|
{
|
||||||
static std::map <const T*, bool> showFull;
|
auto it = m_showFull.find( ptr );
|
||||||
if( showFull.find( ptr ) == showFull.end() )
|
if( it == m_showFull.end() )
|
||||||
{
|
{
|
||||||
showFull[ptr] = true;
|
it = m_showFull.emplace( ptr, true ).first;
|
||||||
}
|
}
|
||||||
|
return it->second;
|
||||||
return showFull[ptr];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Worker m_worker;
|
Worker m_worker;
|
||||||
|
Loading…
Reference in New Issue
Block a user