diff options
| author | Steven Knight <knight@baldmt.com> | 2005-01-21 12:00:30 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2005-01-21 12:00:30 (GMT) |
| commit | 9925c571d1b4efcfba5838bf93971f98f34cc17d (patch) | |
| tree | 43dc31c3adcc426161d7c53c9a60cc9ec1d5ac35 /src/engine/SCons/Node/FS.py | |
| parent | 7f820e64f11a4f047685713c163ca5fee35e676c (diff) | |
| download | SCons-9925c571d1b4efcfba5838bf93971f98f34cc17d.zip SCons-9925c571d1b4efcfba5838bf93971f98f34cc17d.tar.gz SCons-9925c571d1b4efcfba5838bf93971f98f34cc17d.tar.bz2 | |
Regain lost performance improvements by using paths instead of targets for scanner calls and re-using Binder objects for identical paths.
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 50e3818..789d5c3 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -612,11 +612,11 @@ class Entry(Base): self.clear() return File.rfile(self) - def get_found_includes(self, env, scanner, target): + def get_found_includes(self, env, scanner, path): """If we're looking for included files, it's because this Entry is really supposed to be a File itself.""" node = self.rfile() - return node.get_found_includes(env, scanner, target) + return node.get_found_includes(env, scanner, path) def scanner_key(self): return self.get_suffix() @@ -1456,29 +1456,13 @@ class File(Base): except AttributeError: return None - def get_found_includes(self, env, scanner, target): + def get_found_includes(self, env, scanner, path): """Return the included implicit dependencies in this file. - Cache results so we only scan the file once regardless of - how many times this information is requested.""" + Cache results so we only scan the file once per path + regardless of how many times this information is requested. + __cacheable__""" if not scanner: return [] - - try: - path = target.scanner_paths[scanner] - except AttributeError: - # The target had no scanner_paths attribute, which means - # it's an Alias or some other node that's not actually a - # file. In that case, back off and use the path for this - # node itself. - try: - path = self.scanner_paths[scanner] - except KeyError: - path = scanner.path(env, self.cwd, target) - self.scanner_paths[scanner] = path - except KeyError: - path = scanner.path(env, target.cwd, target) - target.scanner_paths[scanner] = path - return scanner(self, env, path) def _createDir(self): |
