1
0
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:
Bartosz Taudul
2019-03-14 01:23:37 +01:00
parent f57cac9042
commit a0299cc63a
3 changed files with 6 additions and 7 deletions
+2
View File
@@ -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 ) )