summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-29 16:09:46 +0000
committerSteve Sakoman <steve@sakoman.com>2024-12-09 06:54:14 -0800
commitac3e66f1a666a1177b3677de56356cae10e5fe1a (patch)
treec3d20bcc64201c541c059d3df7fea4e97ad61d8c /bitbake
parent4f26b1b6a56f02f0abca53853902600d0b6f5d1e (diff)
downloadpoky-ac3e66f1a666a1177b3677de56356cae10e5fe1a.tar.gz
bitbake: runqueue: Optimise setscene loop processing
Rather than looping through things we looped through on the previous execution, start looping where we left off for setscene processing. This gives speed improvements depending on the kind of build being executed. (Bitbake rev: 28569e9796d4b34d7b77b4f79074ab7854850386) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 00f4d932e3af0eeb333339cbe942010fc76dee0f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 744542b082..75aef96a02 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -14,6 +14,7 @@ import os
14import sys 14import sys
15import stat 15import stat
16import errno 16import errno
17import itertools
17import logging 18import logging
18import re 19import re
19import bb 20import bb
@@ -2189,11 +2190,16 @@ class RunQueueExecute:
2189 if not hasattr(self, "sorted_setscene_tids"): 2190 if not hasattr(self, "sorted_setscene_tids"):
2190 # Don't want to sort this set every execution 2191 # Don't want to sort this set every execution
2191 self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids) 2192 self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids)
2193 # Resume looping where we left off when we returned to feed the mainloop
2194 self.setscene_tids_generator = itertools.cycle(self.rqdata.runq_setscene_tids)
2192 2195
2193 task = None 2196 task = None
2194 if not self.sqdone and self.can_start_task(): 2197 if not self.sqdone and self.can_start_task():
2195 # Find the next setscene to run 2198 loopcount = 0
2196 for nexttask in self.sorted_setscene_tids: 2199 # Find the next setscene to run, exit the loop when we've processed all tids or found something to execute
2200 while loopcount < len(self.rqdata.runq_setscene_tids):
2201 loopcount += 1
2202 nexttask = next(self.setscene_tids_generator)
2197 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values() and nexttask not in self.sq_harddep_deferred: 2203 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values() and nexttask not in self.sq_harddep_deferred:
2198 if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete: 2204 if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete:
2199 # Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds 2205 # Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds