Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-08-03 15:35:01 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-08-03 15:35:01 +0300
commita76622d17ab41fcca17eada9156d68d9dd0bee42 (patch)
tree763fa5fedd3f887ed4b9bc24bffac4c581bd3fa9 /server/TracyWorker.hpp
parent8a0701025d1b69f98b533d7c919cf95a0b53e2c9 (diff)
Cache last searched ThreadData.
Diffstat (limited to 'server/TracyWorker.hpp')
-rw-r--r--server/TracyWorker.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp
index 2915c0de..2acbc89c 100644
--- a/server/TracyWorker.hpp
+++ b/server/TracyWorker.hpp
@@ -137,7 +137,7 @@ private:
struct DataBlock
{
- DataBlock() : zonesCnt( 0 ), lastTime( 0 ), frameOffset( 0 ), threadLast( std::numeric_limits<uint64_t>::max(), 0 ) {}
+ DataBlock() : zonesCnt( 0 ), lastTime( 0 ), frameOffset( 0 ), threadLast( std::numeric_limits<uint64_t>::max(), 0 ), threadDataLast( std::numeric_limits<uint64_t>::max(), nullptr ) {}
std::shared_mutex lock;
StringDiscovery<FrameData*> frames;
@@ -177,6 +177,7 @@ private:
flat_hash_map<uint64_t, uint16_t, nohash<uint64_t>> threadMap;
Vector<uint64_t> threadExpand;
std::pair<uint64_t, uint16_t> threadLast;
+ std::pair<uint64_t, ThreadData*> threadDataLast;
Vector<Vector<ZoneEvent*>> zoneChildren;
Vector<Vector<GpuEvent*>> gpuChildren;
@@ -430,8 +431,13 @@ private:
void InsertMessageData( MessageData* msg, uint64_t thread );
+ ThreadData* NoticeThreadReal( uint64_t thread );
ThreadData* NewThread( uint64_t thread );
- ThreadData* NoticeThread( uint64_t thread );
+ ThreadData* NoticeThread( uint64_t thread )
+ {
+ if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;
+ return NoticeThreadReal( thread );
+ }
tracy_force_inline void NewZone( ZoneEvent* zone, uint64_t thread );