[oe-commits] [bitbake] branch master-next updated: runqueue: Fix next_buildable_task performance problem
git at git.openembedded.org
git at git.openembedded.org
Tue Aug 13 19:16:25 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
The following commit(s) were added to refs/heads/master-next by this push:
new 03247cf runqueue: Fix next_buildable_task performance problem
03247cf is described below
commit 03247cf715f5a372370a6247275e873c33887fe9
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Aug 13 20:14:49 2019 +0100
runqueue: Fix next_buildable_task performance problem
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/runqueue.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 9acad7a..3bcbaee 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -133,7 +133,7 @@ class RunQueueScheduler(object):
self.prio_map = [self.rqdata.runtaskentries.keys()]
- self.buildable = []
+ self.buildable = set()
self.skip_maxthread = {}
self.stamps = {}
for tid in self.rqdata.runtaskentries:
@@ -148,8 +148,10 @@ class RunQueueScheduler(object):
"""
Return the id of the first task we find that is buildable
"""
- self.buildable = [x for x in self.buildable if x not in self.rq.runq_running]
- buildable = [x for x in self.buildable if (x in self.rq.tasks_covered or x in self.rq.tasks_notcovered) and x not in self.rq.holdoff_tasks]
+ buildable = set(self.buildable)
+ buildable.difference_update(self.rq.runq_running)
+ buildable.difference_update(self.rq.holdoff_tasks)
+ buildable.intersection_update(self.rq.tasks_covered | self.rq.tasks_notcovered)
if not buildable:
return None
@@ -167,7 +169,7 @@ class RunQueueScheduler(object):
skip_buildable[rtaskname] = 1
if len(buildable) == 1:
- tid = buildable[0]
+ tid = buildable.pop()
taskname = taskname_from_tid(tid)
if taskname in skip_buildable and skip_buildable[taskname] >= int(self.skip_maxthread[taskname]):
return None
@@ -204,7 +206,7 @@ class RunQueueScheduler(object):
return self.next_buildable_task()
def newbuildable(self, task):
- self.buildable.append(task)
+ self.buildable.add(task)
def removebuildable(self, task):
self.buildable.remove(task)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list