From e8d64de5c1827e5a850d19239323095ce7cfdde7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 12 Sep 2017 02:12:45 +0200 Subject: [PATCH] Disable LZ4 in debug builds (too slow). --- client/TracyProfiler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 5b24ac99..c8791220 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -95,6 +95,14 @@ void Profiler::Worker() } sock->Send( &m_timeBegin, sizeof( m_timeBegin ) ); +#ifdef _DEBUG + // notify client that lz4 compression is disabled (too slow in debug builds) + char val = 0; + sock->Send( &val, 1 ); +#else + char val = 1; + sock->Send( &val, 1 ); +#endif for(;;) { @@ -112,10 +120,14 @@ void Profiler::Worker() memcpy( ptr, item+i, dsz ); ptr += dsz; } +#ifdef _DEBUG + if( sock->Send( buf, ptr - buf ) == -1 ) break; +#else char lz4[LZ4Size + sizeof( uint16_t )]; const uint16_t lz4sz = LZ4_compress_default( buf, lz4+2, ptr - buf, LZ4Size ); memcpy( lz4, &lz4sz, sizeof( uint16_t ) ); if( sock->Send( lz4, lz4sz ) == -1 ) break; +#endif } else {