diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-12-13 00:18:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-13 00:18:10 (GMT) |
commit | 6929ca17fa0d14b26c215b48f3b84e7117132bb2 (patch) | |
tree | 8c8481f515db90aade92e8359ec94e608c900cdd | |
parent | b12c27f3e51ffeea325fad53b9cdd0c545d6f01a (diff) | |
parent | 57bb593e4f562e6c6d5f64631bec5962c719295e (diff) | |
download | SCons-6929ca17fa0d14b26c215b48f3b84e7117132bb2.zip SCons-6929ca17fa0d14b26c215b48f3b84e7117132bb2.tar.gz SCons-6929ca17fa0d14b26c215b48f3b84e7117132bb2.tar.bz2 |
Merge pull request #3490 from chasinglogic/less-list-manipulation-in-DAG-walk
Improve DAG walk performance by preventing unnecessary list manipulation
-rwxr-xr-x | src/CHANGES.txt | 2 | ||||
-rw-r--r-- | src/engine/SCons/Taskmaster.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 47b63ee..c837157 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -46,6 +46,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Improved threading performance by ensuring NodeInfo is shared across threads. Results in ~13% improvement for parallel builds (-j# > 1) with many shared nodes. + - Improved DAG walk performance by reducing unnecessary work when + there are no un-visited children. From Mats Wichmann - Replace instances of string find method with "in" checks where diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index 4892026..06fc94c 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -874,8 +874,10 @@ class Taskmaster(object): # These nodes have not even been visited yet. Add # them to the list so that on some next pass we can # take a stab at evaluating them (or their children). - children_not_visited.reverse() - self.candidates.extend(self.order(children_not_visited)) + if children_not_visited: + if len(children_not_visited) > 1: + children_not_visited.reverse() + self.candidates.extend(self.order(children_not_visited)) # if T and children_not_visited: # T.write(self.trace_message(' adding to candidates: %s' % map(str, children_not_visited))) |