mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ECL peaceman well: replace std::unordered_map by std::map
say 99.95% of all time: premature optimization is the root of all evil. in this case it turned out that iterating over a std::unordered_map is very slow and that this is a quite common operation in ebos. Fortunately the fix for this problem is very simple: use the tree-based std::map instead of the hash function based std::unordered_map. on SPE9 this yielded a performance improvement of about 10% on my machine...
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
#include <dune/common/version.hh>
|
#include <dune/common/version.hh>
|
||||||
#include <dune/geometry/referenceelements.hh>
|
#include <dune/geometry/referenceelements.hh>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <map>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
namespace Properties {
|
namespace Properties {
|
||||||
@@ -1414,7 +1414,7 @@ protected:
|
|||||||
|
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
|
||||||
std::unordered_map<int, DofVariables> dofVariables_;
|
std::map<int, DofVariables> dofVariables_;
|
||||||
|
|
||||||
// the number of times beginIteration*() was called for the current time step
|
// the number of times beginIteration*() was called for the current time step
|
||||||
int iterationIdx_;
|
int iterationIdx_;
|
||||||
|
|||||||
Reference in New Issue
Block a user