about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-05-22T11·02+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-22T11·02+0200
commit9fd7cf98dbec047343baefa65cd26ce4493bee53 (patch)
treeb9a1e8e121bdd3ee75579c6b4d4bd6cf143722e4 /src/libexpr/eval.hh
parent9064dd2f4daab34718c0143be235e8eb95c671bd (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.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 86e93a5ac9..8594a2707d 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);