1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Cache context switch data queries.

This commit is contained in:
Bartosz Taudul
2019-08-14 20:16:11 +02:00
parent cf4e04440e
commit 9a364fe5fe
2 changed files with 18 additions and 3 deletions
+3 -1
View File
@@ -1318,11 +1318,13 @@ uint64_t Worker::GetContextSwitchCount() const
return cnt;
}
const ContextSwitch* const Worker::GetContextSwitchData( uint64_t thread ) const
const ContextSwitch* const Worker::GetContextSwitchDataImpl( uint64_t thread )
{
auto it = m_data.ctxSwitch.find( thread );
if( it != m_data.ctxSwitch.end() )
{
m_data.ctxSwitchLast.first = thread;
m_data.ctxSwitchLast.second = it->second;
return it->second;
}
else