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:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user