mesh::data: Use a DynamicList for the performance data for efficiency

This commit is contained in:
Henry Weller
2019-04-01 18:13:15 +01:00
parent 7cf6c4ea47
commit 51247eec60

View File

@ -38,7 +38,8 @@ void Foam::data::setSolverPerformance
{
dictionary& dict = const_cast<dictionary&>(solverPerformanceDict());
List<SolverPerformance<Type>> perfs;
// Use a DynamicList to improve performance of the append
DynamicList<SolverPerformance<Type>> perfs;
const label timeIndex =
this->time().subCycling()
@ -57,7 +58,7 @@ void Foam::data::setSolverPerformance
}
// Append to list
perfs.setSize(perfs.size()+1, sp);
perfs.append(sp);
dict.set(name, perfs);
}