mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Optimize calculation of standard deviation.
This commit is contained in:
@@ -2590,6 +2590,7 @@ void Worker::ProcessZoneEnd( const QueueZoneEnd& ev )
|
||||
slz.min = std::min( slz.min, timeSpan );
|
||||
slz.max = std::max( slz.max, timeSpan );
|
||||
slz.total += timeSpan;
|
||||
slz.sumSq += double( timeSpan ) * timeSpan;
|
||||
if( zone->child >= 0 )
|
||||
{
|
||||
for( auto& v : GetZoneChildren( zone->child ) )
|
||||
@@ -3587,6 +3588,7 @@ void Worker::ReadTimelineUpdateStatistics( ZoneEvent* zone, uint16_t thread )
|
||||
slz.min = std::min( slz.min, timeSpan );
|
||||
slz.max = std::max( slz.max, timeSpan );
|
||||
slz.total += timeSpan;
|
||||
slz.sumSq += double( timeSpan ) * timeSpan;
|
||||
if( zone->child >= 0 )
|
||||
{
|
||||
for( auto& v : GetZoneChildren( zone->child ) )
|
||||
|
||||
Reference in New Issue
Block a user