Several performance fixes (#9026)

* #9023 Performance: Use count instead of for loop

* #9023  Analyzer: Cache vector names for categories

* #9023 Performance : Use cached ensemble analyzer

* #9023 Performance : Add min/max values to ensemble statistics

* #9023 Performance : Improve statistics calculator

* #9023 Performance : Use high performance toInt()

* #9023 Performance : Build summary addresses in parallell
This commit is contained in:
Magne Sjaastad
2022-06-07 21:09:36 +02:00
committed by GitHub
parent fa1f189709
commit d36bf11c62
17 changed files with 331 additions and 82 deletions

View File

@@ -105,20 +105,16 @@ void RigStatisticsMath::calculateStatisticsCurves( const std::vector<double>& va
P90
};
std::vector<double> sortedValues;
double valueSum = 0;
std::vector<double> sortedValues = values;
{
std::multiset<double> vSet( values.begin(), values.end() );
for ( double v : vSet )
{
if ( RiaStatisticsTools::isValidNumber( v ) )
{
sortedValues.push_back( v );
valueSum += v;
}
}
}
sortedValues.erase( std::remove_if( sortedValues.begin(),
sortedValues.end(),
[]( double x ) { return !RiaStatisticsTools::isValidNumber( x ); } ),
sortedValues.end() );
std::sort( sortedValues.begin(), sortedValues.end() );
double valueSum = std::accumulate( sortedValues.begin(), sortedValues.end(), 0.0 );
int valueCount = (int)sortedValues.size();
double percentiles[] = { 0.1, 0.5, 0.9 };