Skip to content

Commit 8e80df6

Browse files
rpurdieleimaohui
authored andcommitted
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: 00f4d932e3af0eeb333339cbe942010fc76dee0f) Signed-off-by: Richard Purdie <[email protected]>
1 parent 91e32a8 commit 8e80df6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bitbake/lib/bb/runqueue.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sys
1515
import stat
1616
import errno
17+
import itertools
1718
import logging
1819
import re
1920
import bb
@@ -2204,11 +2205,16 @@ def execute(self):
22042205
if not hasattr(self, "sorted_setscene_tids"):
22052206
# Don't want to sort this set every execution
22062207
self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids)
2208+
# Resume looping where we left off when we returned to feed the mainloop
2209+
self.setscene_tids_generator = itertools.cycle(self.rqdata.runq_setscene_tids)
22072210

22082211
task = None
22092212
if not self.sqdone and self.can_start_task():
2210-
# Find the next setscene to run
2211-
for nexttask in self.sorted_setscene_tids:
2213+
loopcount = 0
2214+
# Find the next setscene to run, exit the loop when we've processed all tids or found something to execute
2215+
while loopcount < len(self.rqdata.runq_setscene_tids):
2216+
loopcount += 1
2217+
nexttask = next(self.setscene_tids_generator)
22122218
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:
22132219
if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete:
22142220
# Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds

0 commit comments

Comments
 (0)