aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-14 18:17:01 +0000
committerArmin Kuster <akuster808@gmail.com>2019-12-17 22:14:47 -0800
commita80024a4397485f96693c4df108b40f6b1bdf32b (patch)
tree495e7b50a451b79afb2fa68f65a90cb8bdfaffb9
parentc4ce216b4c5a1626764752edd21005750d05a0c2 (diff)
downloadbitbake-contrib-a80024a4397485f96693c4df108b40f6b1bdf32b.tar.gz
runqueue: Fix sstate task iteration performance
Creating a new sorted list of sstate tasks each iteration through runqueue is extremely ineffecient and was compounded by the recent change from a list to set. Create one sorted list instead of recreating it each time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit de18824996841c3f35f54ff5ad12f94f6dc20d88)
-rw-r--r--lib/bb/runqueue.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 515e9d431..2ba4557f9 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1965,10 +1965,14 @@ class RunQueueExecute:
self.rq.read_workers()
self.process_possible_migrations()
+ if not hasattr(self, "sorted_setscene_tids"):
+ # Don't want to sort this set every execution
+ self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids)
+
task = None
if not self.sqdone and self.can_start_task():
# Find the next setscene to run
- for nexttask in sorted(self.rqdata.runq_setscene_tids):
+ for nexttask in self.sorted_setscene_tids:
if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values():
if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]):
if nexttask not in self.rqdata.target_tids: