1. dirkbaechle
  2. SCons_experimental

Commits

dirkbaechle  committed 4ff08bc

- added caching for get_found_includes()

  • Participants
  • Parent commits b105060
  • Branches speedups

Comments (0)

Files changed (2)

File src/engine/SCons/Node/FS.py

View file
  • Ignore whitespace
 
         if scanner:
             # result = [n.disambiguate() for n in scanner(self, env, path)]
-            result = scanner(self, env, path)
-            result = [N.disambiguate() for N in result]
+            dkey = str(id(env))+str(id(self))
+            if path:
+                dkey += ''.join(map(str, path))
+            try:
+                return scanner._memo_get_found_includes[dkey]
+            except KeyError:
+                result = scanner(self, env, path)
+                result = [N.disambiguate() for N in result]
+                scanner._memo_get_found_includes[dkey] = result      
         else:
             result = []
 

File src/engine/SCons/Scanner/__init__.py

View file
  • Ignore whitespace
             self.recurse_nodes = self._recurse_all_nodes
         else:
             self.recurse_nodes = self._recurse_no_nodes
+        self._memo_get_found_includes = {}
 
     def path(self, env, dir=None, target=None, source=None):
         if not self.path_function: