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

@@ -182,7 +182,7 @@ std::set<int> RiaSummaryAddressAnalyzer::aquifers() const
//--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryAddressAnalyzer::categories() const
{
return m_categories;
return keysInMap( m_categories );
}
//--------------------------------------------------------------------------------------------------
@@ -312,6 +312,18 @@ std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( con
return curveName + historyIdentifier;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<std::string>
RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddress::SummaryVarCategory category )
{
auto it = m_categories.find( category );
if ( it != m_categories.end() ) return it->second;
return {};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -433,7 +445,12 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
{
m_categories.insert( address.category() );
if ( m_categories.count( address.category() ) == 0 )
{
m_categories[address.category()] = { address.vectorName() };
}
else
m_categories[address.category()].insert( address.vectorName() );
}
}
@@ -463,6 +480,20 @@ std::set<int> RiaSummaryAddressAnalyzer::keysInMap( const std::multimap<int, Rif
return keys;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryAddressAnalyzer::keysInMap(
const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map )
{
std::set<RifEclipseSummaryAddress::SummaryVarCategory> keys;
for ( const auto& [key, value] : map )
{
keys.insert( key );
}
return keys;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------