diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-05-22T11·02+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-05-22T11·02+0200 |
commit | 9fd7cf98dbec047343baefa65cd26ce4493bee53 (patch) | |
tree | b9a1e8e121bdd3ee75579c6b4d4bd6cf143722e4 /src/libexpr/eval.hh | |
parent | 9064dd2f4daab34718c0143be235e8eb95c671bd (diff) |
Memoise checkSourcePath()
This prevents hydra-eval-jobs from statting the same files over and over again.
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r-- | src/libexpr/eval.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 86e93a5ac9ce..8594a2707d9a 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -7,6 +7,7 @@ #include "hash.hh" #include <map> +#include <unordered_map> namespace nix { @@ -100,6 +101,9 @@ private: std::map<std::string, std::pair<bool, std::string>> searchPathResolved; + /* Cache used by checkSourcePath(). */ + std::unordered_map<Path, Path> resolvedPaths; + public: EvalState(const Strings & _searchPath, ref<Store> store); |