From 9563c8316d66d50a8b7835db7a76bc1cd703c4e4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 9 Mar 2019 14:20:34 +0100 Subject: [PATCH] Optimize lock drawing. Don't iterate over locks that are present in only one thread, if only contended lock events are to be displayed. Such locks cannot be contended. --- server/TracyView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index b4e42ab6..1262dfe5 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3128,6 +3128,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { const auto& lockmap = v.second; if( !lockmap.valid || !Vis( &lockmap ).visible ) continue; + if( m_onlyContendedLocks && lockmap.threadList.size() == 1 && m_lockInfoWindow != v.first ) continue; auto it = lockmap.threadMap.find( tid ); if( it == lockmap.threadMap.end() ) continue;