From 868fbace5a4ff85536473bd8ff24ecbc792c3337 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Apr 2018 02:04:51 +0200 Subject: [PATCH] Don't compress thread twice, if it's the same. --- server/TracyWorker.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 97be614b..52b26459 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -524,11 +524,17 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Read( &mem->size, sizeof( mem->size ) ); f.Read( &mem->timeAlloc, sizeof( mem->timeAlloc ) ); f.Read( &mem->timeFree, sizeof( mem->timeFree ) ); - uint64_t t; - f.Read( &t, sizeof( t ) ); - mem->threadAlloc = CompressThread( t ); - f.Read( &t, sizeof( t ) ); - mem->threadFree = CompressThread( t ); + uint64_t t[2]; + f.Read( t, sizeof( t ) ); + mem->threadAlloc = CompressThread( t[0] ); + if( t[0] == t[1] ) + { + mem->threadFree = mem->threadAlloc; + } + else + { + mem->threadFree = CompressThread( t[1] ); + } if( mem->timeFree < 0 ) {