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.
This commit is contained in:
Bartosz Taudul 2019-03-09 14:20:34 +01:00
parent e8d9de2f77
commit 9563c8316d

View File

@ -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;