mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Optimize mem plot reconstruction loop.
This commit is contained in:
parent
76f0c8fafe
commit
553e3ca38b
@ -1955,27 +1955,40 @@ void Worker::ReconstructMemAllocPlot()
|
|||||||
ptr->val = 0;
|
ptr->val = 0;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
while( aptr != aend && fptr != fend )
|
if( aptr != aend && fptr != fend )
|
||||||
{
|
{
|
||||||
int64_t time;
|
auto atime = aptr->timeAlloc;
|
||||||
if( aptr->timeAlloc < fptr->time )
|
auto ftime = fptr->time;
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
if( atime < ftime )
|
||||||
{
|
{
|
||||||
time = aptr->timeAlloc;
|
|
||||||
usage += int64_t( aptr->size );
|
usage += int64_t( aptr->size );
|
||||||
|
assert( usage >= 0 );
|
||||||
|
if( max < usage ) max = usage;
|
||||||
|
ptr->time = atime;
|
||||||
|
ptr->val = usage;
|
||||||
|
ptr++;
|
||||||
aptr++;
|
aptr++;
|
||||||
|
if( aptr == aend ) break;
|
||||||
|
atime = aptr->timeAlloc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
time = fptr->time;
|
|
||||||
usage -= fptr->size;
|
usage -= fptr->size;
|
||||||
fptr++;
|
|
||||||
}
|
|
||||||
assert( usage >= 0 );
|
assert( usage >= 0 );
|
||||||
if( max < usage ) max = usage;
|
if( max < usage ) max = usage;
|
||||||
ptr->time = time;
|
ptr->time = ftime;
|
||||||
ptr->val = usage;
|
ptr->val = usage;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
fptr++;
|
||||||
|
if( fptr == fend ) break;
|
||||||
|
ftime = fptr->time;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while( aptr != aend )
|
while( aptr != aend )
|
||||||
{
|
{
|
||||||
assert( aptr->timeFree < 0 );
|
assert( aptr->timeFree < 0 );
|
||||||
|
Loading…
Reference in New Issue
Block a user