Summary performance improvements

* Check flag before rebuilding summary address nodes
* Performance: Use vector instead of set and map locally in thread
* Performance: Skip looking for restart summary filenames for opm-common
* Move adding of case realization parameters to OpenMP loop
* Add unit test for file path operations
* Performance: Avoid using cdUp() function when splitting path into strings
This commit is contained in:
Magne Sjaastad
2024-03-18 11:46:43 +01:00
committed by GitHub
parent 63defd0f1a
commit a880a42752
10 changed files with 131 additions and 41 deletions

View File

@@ -204,9 +204,12 @@ QStringList RiaFilePathTools::splitPathIntoComponents( const QString& inputPath,
{
auto path = QDir::cleanPath( inputPath );
QStringList components;
auto indexOfLastSeparator = path.lastIndexOf( separator() );
auto indexOfDrive = path.indexOf( ':' );
QDir dir( path );
QString pathWithoutDrive = path.mid( indexOfDrive + 1, indexOfLastSeparator - ( indexOfDrive + 1 ) );
QStringList components = RiaTextStringTools::splitSkipEmptyParts( pathWithoutDrive, separator() );
QFileInfo fileInfo( path );
@@ -214,18 +217,14 @@ QStringList RiaFilePathTools::splitPathIntoComponents( const QString& inputPath,
{
QString extension = fileInfo.completeSuffix();
path = path.replace( QString( ".%1" ).arg( extension ), "" );
components.push_front( extension );
components.push_front( fileInfo.baseName() );
components.push_back( extension );
components.push_back( fileInfo.baseName() );
}
else
{
components.push_back( fileInfo.fileName() );
}
while ( dir.cdUp() )
{
components.push_front( dir.dirName() );
}
return components;
}
@@ -330,16 +329,10 @@ std::map<QString, QStringList> RiaFilePathTools::keyPathComponentsForEachFilePat
{
std::map<QString, QStringList> allComponents;
std::multiset<QString> allPathComponents;
for ( auto fileName : filePaths )
{
QStringList pathComponentsForFile = splitPathIntoComponents( fileName, true );
allComponents[fileName] = pathComponentsForFile;
for ( auto pathComponent : pathComponentsForFile )
{
allPathComponents.insert( pathComponent );
}
}
auto topNode = std::unique_ptr<PathNode>( new PathNode( "", nullptr ) );