mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Calculate sorted zone times for find zone histogram.
This commit is contained in:
parent
e81218ddaf
commit
f66ed00d71
@ -4599,6 +4599,28 @@ void View::DrawFindZone()
|
||||
const auto tmax = zoneData.max;
|
||||
const auto timeTotal = zoneData.total;
|
||||
|
||||
const auto zsz = zones.size();
|
||||
if( m_findZone.sortedNum != zsz )
|
||||
{
|
||||
auto& vec = m_findZone.sorted;
|
||||
vec.reserve( zsz );
|
||||
size_t i;
|
||||
for( i=m_findZone.sortedNum; i<zsz; i++ )
|
||||
{
|
||||
auto& zone = *zones[i].zone;
|
||||
if( zone.end < 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
const auto t = zone.end - zone.start;
|
||||
m_findZone.sorted.emplace_back( t );
|
||||
}
|
||||
auto mid = vec.begin() + m_findZone.sortedNum;
|
||||
pdqsort_branchless( mid, vec.end() );
|
||||
std::inplace_merge( vec.begin(), mid, vec.end() );
|
||||
m_findZone.sortedNum = i;
|
||||
}
|
||||
|
||||
if( tmin != std::numeric_limits<int64_t>::max() )
|
||||
{
|
||||
ImGui::Checkbox( "Log values", &m_findZone.logVal );
|
||||
|
@ -291,6 +291,8 @@ private:
|
||||
Region highlight;
|
||||
int64_t numBins = -1;
|
||||
std::unique_ptr<int64_t[]> bins, binTime, selBin;
|
||||
std::vector<int64_t> sorted;
|
||||
size_t sortedNum;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@ -299,6 +301,8 @@ private:
|
||||
selMatch = 0;
|
||||
selGroup = Unselected;
|
||||
highlight.active = false;
|
||||
sorted.clear();
|
||||
sortedNum = 0;
|
||||
}
|
||||
|
||||
void ResetGroups()
|
||||
|
Loading…
Reference in New Issue
Block a user