mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "QElapsedTimer"
|
||||
#include "RigStatisticsMath.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -295,3 +296,37 @@ TEST( RigStatisticsMath, calculateStatisticsCurves )
|
||||
EXPECT_DOUBLE_EQ( 1.0, mean );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( RigStatisticsMath, DISABLED_performanceTesting )
|
||||
{
|
||||
RigStatisticsMath::PercentileStyle percentileStyle = RigStatisticsMath::PercentileStyle::REGULAR;
|
||||
{
|
||||
size_t timerCount = 10;
|
||||
for ( size_t t = 0; t < timerCount; t++ )
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
size_t iterationCount = 10000;
|
||||
for ( size_t i = 0; i < iterationCount; i++ )
|
||||
{
|
||||
size_t numberOfValues = 200;
|
||||
std::vector<double> values( numberOfValues );
|
||||
std::iota( values.begin(), values.end(), numberOfValues );
|
||||
|
||||
double mean = HUGE_VAL;
|
||||
double p10 = HUGE_VAL;
|
||||
double p50 = HUGE_VAL;
|
||||
double p90 = HUGE_VAL;
|
||||
|
||||
RigStatisticsMath::calculateStatisticsCurves( values, &p10, &p50, &p90, &mean, percentileStyle );
|
||||
}
|
||||
|
||||
auto testDuration = timer.elapsed();
|
||||
std::cout << testDuration << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user