diff --git a/profiler/src/profiler/TracyView_FlameGraph.cpp b/profiler/src/profiler/TracyView_FlameGraph.cpp index b6c10f34..4b0458a9 100644 --- a/profiler/src/profiler/TracyView_FlameGraph.cpp +++ b/profiler/src/profiler/TracyView_FlameGraph.cpp @@ -4,7 +4,6 @@ #include "TracyPrint.hpp" #include "TracyVector.hpp" #include "TracyView.hpp" -#include "tracy_robin_hood.h" namespace tracy { @@ -18,9 +17,6 @@ struct FlameGraphItem static void BuildFlameGraph( const Worker& worker, Vector& data, const Vector>& zones ) { - unordered_flat_map map; - for( size_t i=0; i*)&zones; @@ -29,10 +25,9 @@ static void BuildFlameGraph( const Worker& worker, Vector& data, if( !v.IsEndValid() ) break; const auto srcloc = v.SrcLoc(); const auto duration = v.End() - v.Start(); - auto it = map.find( srcloc ); - if( it == map.end() ) + auto it = std::find_if( data.begin(), data.end(), [srcloc]( const auto& v ) { return v.srcloc == srcloc; } ); + if( it == data.end() ) { - map.emplace( srcloc, data.size() ); data.push_back( FlameGraphItem { srcloc, duration } ); if( v.HasChildren() ) { @@ -42,12 +37,11 @@ static void BuildFlameGraph( const Worker& worker, Vector& data, } else { - auto& item = data[it->second]; - item.time += duration; + it->time += duration; if( v.HasChildren() ) { auto& children = worker.GetZoneChildren( v.Child() ); - BuildFlameGraph( worker, item.children, children ); + BuildFlameGraph( worker, it->children, children ); } } } @@ -59,10 +53,9 @@ static void BuildFlameGraph( const Worker& worker, Vector& data, if( !v->IsEndValid() ) break; const auto srcloc = v->SrcLoc(); const auto duration = v->End() - v->Start(); - auto it = map.find( srcloc ); - if( it == map.end() ) + auto it = std::find_if( data.begin(), data.end(), [srcloc]( const auto& v ) { return v.srcloc == srcloc; } ); + if( it == data.end() ) { - map.emplace( srcloc, data.size() ); data.push_back( FlameGraphItem { srcloc, duration } ); if( v->HasChildren() ) { @@ -72,12 +65,11 @@ static void BuildFlameGraph( const Worker& worker, Vector& data, } else { - auto& item = data[it->second]; - item.time += duration; + it->time += duration; if( v->HasChildren() ) { auto& children = worker.GetZoneChildren( v->Child() ); - BuildFlameGraph( worker, item.children, children ); + BuildFlameGraph( worker, it->children, children ); } } }