From 2425a927c7a01fa2d42ff3ed6bbbd21ae582a87a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 14 Dec 2019 18:17:01 +0000 Subject: 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 (cherry picked from commit e28ec69356f1797de3e4e3fca0fef710bc4564de) Signed-off-by: Richard Purdie --- bitbake/lib/bb/runqueue.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bitbake') 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: # 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() -- cgit v1.2.3-54-g00ecf