diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-14 18:17:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-11 11:06:22 +0000 |
commit | 2425a927c7a01fa2d42ff3ed6bbbd21ae582a87a (patch) | |
tree | a825f3c4c2e134758a0b30265bd8195c1a020b0d | |
parent | db413b50500b8436819d7ee973241d14124fd072 (diff) | |
download | poky-2425a927c7a01fa2d42ff3ed6bbbd21ae582a87a.tar.gz |
bitbake: 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.
(Bitbake rev: 57df7f191755dd887827d51b125d246c1af3e1b6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e28ec69356f1797de3e4e3fca0fef710bc4564de)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 2ba4557f9f..6da612b719 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -2268,15 +2268,16 @@ class RunQueueExecute: | |||
2268 | 2268 | ||
2269 | # Work out all tasks which depend upon these | 2269 | # Work out all tasks which depend upon these |
2270 | total = set() | 2270 | total = set() |
2271 | next = set() | ||
2271 | for p in toprocess: | 2272 | for p in toprocess: |
2272 | next = set(self.rqdata.runtaskentries[p].revdeps) | 2273 | next |= self.rqdata.runtaskentries[p].revdeps |
2273 | while next: | 2274 | while next: |
2274 | current = next.copy() | 2275 | current = next.copy() |
2275 | total = total | next | 2276 | total = total | next |
2276 | next = set() | 2277 | next = set() |
2277 | for ntid in current: | 2278 | for ntid in current: |
2278 | next |= self.rqdata.runtaskentries[ntid].revdeps | 2279 | next |= self.rqdata.runtaskentries[ntid].revdeps |
2279 | next.difference_update(total) | 2280 | next.difference_update(total) |
2280 | 2281 | ||
2281 | # Now iterate those tasks in dependency order to regenerate their taskhash/unihash | 2282 | # Now iterate those tasks in dependency order to regenerate their taskhash/unihash |
2282 | next = set() | 2283 | next = set() |