diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-29 16:09:46 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-29 22:13:25 +0000 |
commit | abc603870a9dfe160cec3b90b6c6ea0e97992f11 (patch) | |
tree | 113d4cf93aa941804f73481c131fa6e529c9ea1e /bitbake/lib | |
parent | 05b02e3d57c0cac37694bd3dcf3c8e04c63d75bd (diff) | |
download | poky-abc603870a9dfe160cec3b90b6c6ea0e97992f11.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: 00f4d932e3af0eeb333339cbe942010fc76dee0f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 2179ee1302..6457726d96 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -14,6 +14,7 @@ import os | |||
14 | import sys | 14 | import sys |
15 | import stat | 15 | import stat |
16 | import errno | 16 | import errno |
17 | import itertools | ||
17 | import logging | 18 | import logging |
18 | import re | 19 | import re |
19 | import bb | 20 | import bb |
@@ -2204,11 +2205,16 @@ class RunQueueExecute: | |||
2204 | if not hasattr(self, "sorted_setscene_tids"): | 2205 | if not hasattr(self, "sorted_setscene_tids"): |
2205 | # Don't want to sort this set every execution | 2206 | # Don't want to sort this set every execution |
2206 | self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids) | 2207 | 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) | ||
2207 | 2210 | ||
2208 | task = None | 2211 | task = None |
2209 | if not self.sqdone and self.can_start_task(): | 2212 | if not self.sqdone and self.can_start_task(): |
2210 | # Find the next setscene to run | 2213 | loopcount = 0 |
2211 | for nexttask in self.sorted_setscene_tids: | 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) | ||
2212 | 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: | 2218 | 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: |
2213 | if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete: | 2219 | if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete: |
2214 | # Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds | 2220 | # Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds |