diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-22 19:33:27 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-22 19:33:27 (GMT) |
commit | f7158d025b936cc3cf3f0579ef39df98dc74e8cb (patch) | |
tree | 215b20a3cd51bde9b2163aa213992b29e7a5a02b /src/engine/SCons/Node | |
parent | 7a59fd0e789fb1c924d9feca02e4b83a93924844 (diff) | |
download | SCons-f7158d025b936cc3cf3f0579ef39df98dc74e8cb.zip SCons-f7158d025b936cc3cf3f0579ef39df98dc74e8cb.tar.gz SCons-f7158d025b936cc3cf3f0579ef39df98dc74e8cb.tar.bz2 |
Reduce the number of scanner calls in large cross-products of targets and sources.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 1 | ||||
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 21 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 1a3236e..5018f99 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -94,6 +94,7 @@ class Builder: self.overrides = {} self.action = action self.target_scanner = None + self.source_scanner = None def targets(self, t): return [t] diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 7d737be..4424e61 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -128,6 +128,8 @@ class Builder: self.action = MyAction() self.source_factory = MyNode self.is_explicit = is_explicit + self.target_scanner = None + self.source_scanner = None def targets(self, t): return [t] def get_actions(self): diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 06cb5bf..93a6537 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -467,6 +467,13 @@ class Node: scanner = scanner.select(node) return scanner + def add_to_implicit(self, deps): + if not hasattr(self, 'implicit') or self.implicit is None: + self.implicit = [] + self.implicit_dict = {} + self._children_reset() + self._add_child(self.implicit, self.implicit_dict, deps) + def scan(self): """Scan this node's dependents for implicit dependencies.""" # Don't bother scanning non-derived files, because we don't @@ -500,18 +507,8 @@ class Node: self._children_reset() self.del_binfo() - # Potential optimization for the N^2 problem if we can tie - # scanning to the Executor in some way so that we can scan - # source files onces and then spread the implicit dependencies - # to all of the targets at once. - #kids = self.children(scan=0) - #for child in filter(lambda n: n.implicit is None, kids): - for child in self.children(scan=0): - scanner = self.get_source_scanner(child) - if scanner: - path = self.get_build_scanner_path(scanner) - deps = child.get_implicit_deps(build_env, scanner, path) - self._add_child(self.implicit, self.implicit_dict, deps) + scanner = self.builder.source_scanner + self.get_executor().scan(scanner) # scan this node itself for implicit dependencies scanner = self.builder.target_scanner |