mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-27 11:06:25 -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:
parent
a28affc2cf
commit
7a729e73ac
@ -35,7 +35,7 @@
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/geometry/referenceelements.hh>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
|
||||
namespace Opm {
|
||||
namespace Properties {
|
||||
@ -1414,7 +1414,7 @@ protected:
|
||||
|
||||
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
|
||||
int iterationIdx_;
|
||||
|
Loading…
Reference in New Issue
Block a user