diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2019-12-11 23:43:01 (GMT) |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2019-12-11 23:43:01 (GMT) |
commit | 57bb593e4f562e6c6d5f64631bec5962c719295e (patch) | |
tree | 8c8481f515db90aade92e8359ec94e608c900cdd /src | |
parent | b12c27f3e51ffeea325fad53b9cdd0c545d6f01a (diff) | |
download | SCons-57bb593e4f562e6c6d5f64631bec5962c719295e.zip SCons-57bb593e4f562e6c6d5f64631bec5962c719295e.tar.gz SCons-57bb593e4f562e6c6d5f64631bec5962c719295e.tar.bz2 |
Improve DAG walk performance by preventing unnecessary list manipulation
Diffstat (limited to 'src')
-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))) |