mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Sort plot data only when needed (i.e. to draw).
This commit is contained in:
parent
68d2812e82
commit
b978a7c652
@ -6600,7 +6600,8 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
||||
auto yPos = wpos.y + offset;
|
||||
if( yPos + PlotHeight >= yMin && yPos <= yMax )
|
||||
{
|
||||
const auto& vec = v->data;
|
||||
auto& vec = v->data;
|
||||
if( !vec.is_sorted() ) vec.sort();
|
||||
|
||||
if( v->type == PlotType::Memory )
|
||||
{
|
||||
|
@ -4295,13 +4295,18 @@ void Worker::HandleFrameName( uint64_t name, const char* str, size_t sz )
|
||||
} );
|
||||
}
|
||||
|
||||
void Worker::DoPostponedWork()
|
||||
void Worker::DoPostponedWorkAll()
|
||||
{
|
||||
DoPostponedWork();
|
||||
|
||||
for( auto& plot : m_data.plots.Data() )
|
||||
{
|
||||
if( !plot->data.is_sorted() ) plot->data.sort();
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::DoPostponedWork()
|
||||
{
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
if( m_data.newFramesWereReceived )
|
||||
{
|
||||
@ -7651,7 +7656,7 @@ static void WriteHwSampleVec( FileWrite& f, SortedVector<Int48, Int48Sort>& vec
|
||||
|
||||
void Worker::Write( FileWrite& f, bool fiDict )
|
||||
{
|
||||
DoPostponedWork();
|
||||
DoPostponedWorkAll();
|
||||
|
||||
f.Write( FileHeader, sizeof( FileHeader ) );
|
||||
|
||||
|
@ -624,6 +624,7 @@ public:
|
||||
std::pair<uint64_t, uint64_t> GetTextureCompressionBytes() const { return std::make_pair( m_texcomp.GetInputBytesCount(), m_texcomp.GetOutputBytesCount() ); }
|
||||
|
||||
void DoPostponedWork();
|
||||
void DoPostponedWorkAll();
|
||||
|
||||
private:
|
||||
void Network();
|
||||
|
Loading…
Reference in New Issue
Block a user