Use time limited data for inline stats.

This commit is contained in:
Bartosz Taudul 2020-08-07 19:42:18 +02:00
parent d151aff237
commit d6aa814de5

View File

@ -12191,6 +12191,8 @@ void View::DrawStatistics()
} }
} }
static unordered_flat_map<uint64_t, SymList> inlineMap;
assert( inlineMap.empty() );
if( !m_statSeparateInlines ) if( !m_statSeparateInlines )
{ {
static unordered_flat_map<uint64_t, SymList> baseMap; static unordered_flat_map<uint64_t, SymList> baseMap;
@ -12212,6 +12214,7 @@ void View::DrawStatistics()
it->second.count++; it->second.count++;
} }
} }
for( auto& v : data ) inlineMap.emplace( v.symAddr, SymList { v.symAddr, v.incl, v.excl, v.count } );
data.clear(); data.clear();
for( auto& v : baseMap ) for( auto& v : baseMap )
{ {
@ -12355,8 +12358,8 @@ void View::DrawStatistics()
} }
else else
{ {
auto it = symStat.find( v.symAddr ); auto it = inlineMap.find( v.symAddr );
excl = it != symStat.end() ? it->second.excl : 0; excl = it != inlineMap.end() ? it->second.excl : 0;
} }
if( v.symAddr == 0 || excl == 0 ) if( v.symAddr == 0 || excl == 0 )
{ {
@ -12470,8 +12473,8 @@ void View::DrawStatistics()
Vector<SymList> inSymList; Vector<SymList> inSymList;
while( *inSym < symEnd ) while( *inSym < symEnd )
{ {
auto sit = symStat.find( *inSym ); auto sit = inlineMap.find( *inSym );
if( sit != symStat.end() ) if( sit != inlineMap.end() )
{ {
inSymList.push_back( SymList { *inSym, sit->second.incl, sit->second.excl } ); inSymList.push_back( SymList { *inSym, sit->second.incl, sit->second.excl } );
} }
@ -12481,8 +12484,8 @@ void View::DrawStatistics()
} }
inSym++; inSym++;
} }
auto statIt = symStat.find( v.symAddr ); auto statIt = inlineMap.find( v.symAddr );
if( statIt != symStat.end() ) if( statIt != inlineMap.end() )
{ {
inSymList.push_back( SymList { v.symAddr, statIt->second.incl, statIt->second.excl } ); inSymList.push_back( SymList { v.symAddr, statIt->second.incl, statIt->second.excl } );
} }
@ -12623,6 +12626,8 @@ void View::DrawStatistics()
} }
ImGui::EndColumns(); ImGui::EndColumns();
ImGui::EndChild(); ImGui::EndChild();
inlineMap.clear();
} }
} }
#endif #endif