mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Allow sorting find zone groups by mean time per call.
This commit is contained in:
parent
c5fd347401
commit
b0d319890b
@ -5529,6 +5529,16 @@ void View::DrawFindZone()
|
||||
ImGui::RadioButton( "Count", (int*)( &m_findZone.sortBy ), (int)FindZone::SortBy::Count );
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton( "Time", (int*)( &m_findZone.sortBy ), (int)FindZone::SortBy::Time );
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton( "MTPC", (int*)( &m_findZone.sortBy ), (int)FindZone::SortBy::Mtpc );
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled( "(?)" );
|
||||
if( ImGui::IsItemHovered() )
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text( "Mean time per call" );
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
auto& zones = m_worker.GetZonesForSourceLocation( m_findZone.match[m_findZone.selMatch] ).zones;
|
||||
auto sz = zones.size();
|
||||
@ -5601,6 +5611,9 @@ void View::DrawFindZone()
|
||||
case FindZone::SortBy::Time:
|
||||
pdqsort_branchless( groups.begin(), groups.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.time > rhs->second.time; } );
|
||||
break;
|
||||
case FindZone::SortBy::Mtpc:
|
||||
pdqsort_branchless( groups.begin(), groups.end(), []( const auto& lhs, const auto& rhs ) { return double( lhs->second.time ) / lhs->second.zones.size() > double( rhs->second.time ) / rhs->second.zones.size(); } );
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
|
@ -290,7 +290,7 @@ private:
|
||||
struct FindZone {
|
||||
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
||||
enum class GroupBy : int { Thread, UserText, Callstack };
|
||||
enum class SortBy : int { Order, Count, Time };
|
||||
enum class SortBy : int { Order, Count, Time, Mtpc };
|
||||
|
||||
struct Group
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user