diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-14 18:17:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-15 09:40:33 +0000 |
commit | e28ec69356f1797de3e4e3fca0fef710bc4564de (patch) | |
tree | e5ea62d2c9d2a0f1a8833bbcda75efdab9811393 | |
parent | de18824996841c3f35f54ff5ad12f94f6dc20d88 (diff) | |
download | bitbake-contrib-e28ec69356f1797de3e4e3fca0fef710bc4564de.tar.gz |
runqueue: Optimise task migration code slightly
Move the calls to difference_update out a code level which improves efficiency
significantly.
Also further combine the outer loop for efficiency too.
These two changes remove a bottleneck from the performance charts.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/runqueue.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 2ba4557f9..6da612b71 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -2268,15 +2268,16 @@ class RunQueueExecute: # Work out all tasks which depend upon these total = set() + next = set() for p in toprocess: - next = set(self.rqdata.runtaskentries[p].revdeps) - while next: - current = next.copy() - total = total | next - next = set() - for ntid in current: - next |= self.rqdata.runtaskentries[ntid].revdeps - next.difference_update(total) + next |= self.rqdata.runtaskentries[p].revdeps + while next: + current = next.copy() + total = total | next + next = set() + for ntid in current: + next |= self.rqdata.runtaskentries[ntid].revdeps + next.difference_update(total) # Now iterate those tasks in dependency order to regenerate their taskhash/unihash next = set() |