aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-27 11:04:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-28 12:38:01 +0100
commit6fd723479e8d49227fd58040b3485c1d5afc4bc5 (patch)
tree1104c67c1e074f91085eb461b345fe86b3c70651
parent3190cb83e2af195a464f669c5aa8aedbf795160e (diff)
downloadbitbake-6fd723479e8d49227fd58040b3485c1d5afc4bc5.tar.gz
bitbake-6fd723479e8d49227fd58040b3485c1d5afc4bc5.tar.bz2
bitbake-6fd723479e8d49227fd58040b3485c1d5afc4bc5.zip
runqueue.py: Convert depends variable to use sets
This gives some small performance gains and sets the scene for other improvements by removing the need for duplicate detection code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/runqueue.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index e09e8c80..c45287d0 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -409,7 +409,7 @@ class RunQueueData:
for taskname in tasknames:
taskid = taskData.gettask_id_fromfnid(depdata, taskname)
if taskid is not None:
- depends.append(taskid)
+ depends.add(taskid)
def add_runtime_dependencies(depids, tasknames, depends):
for depid in depids:
@@ -421,10 +421,10 @@ class RunQueueData:
for taskname in tasknames:
taskid = taskData.gettask_id_fromfnid(depdata, taskname)
if taskid is not None:
- depends.append(taskid)
+ depends.add(taskid)
for task in xrange(len(taskData.tasks_name)):
- depends = []
+ depends = set()
recrdepends = []
fnid = taskData.tasks_fnid[task]
fn = taskData.fn_index[fnid]
@@ -437,7 +437,7 @@ class RunQueueData:
# Resolve task internal dependencies
#
# e.g. addtask before X after Y
- depends = taskData.tasks_tdepends[task]
+ depends = set(taskData.tasks_tdepends[task])
# Resolve 'deptask' dependencies
#
@@ -470,7 +470,7 @@ class RunQueueData:
taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
if taskid is None:
bb.msg.fatal("RunQueue", "Task %s in %s depends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, dep))
- depends.append(taskid)
+ depends.add(taskid)
if depdata != fnid:
tdepends_fnid[fnid].add(taskid)
irdepends = taskData.tasks_irdepends[task]
@@ -482,7 +482,7 @@ class RunQueueData:
taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
if taskid is None:
bb.msg.fatal("RunQueue", "Task %s in %s rdepends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, dep))
- depends.append(taskid)
+ depends.add(taskid)
if depdata != fnid:
tdepends_fnid[fnid].add(taskid)
@@ -499,16 +499,12 @@ class RunQueueData:
# Rmove all self references
if task in depends:
- newdep = []
logger.debug(2, "Task %s (%s %s) contains self reference! %s", task, taskData.fn_index[taskData.tasks_fnid[task]], taskData.tasks_name[task], depends)
- for dep in depends:
- if task != dep:
- newdep.append(dep)
- depends = newdep
+ depends.remove(task)
self.runq_fnid.append(taskData.tasks_fnid[task])
self.runq_task.append(taskData.tasks_name[task])
- self.runq_depends.append(set(depends))
+ self.runq_depends.append(depends)
self.runq_revdeps.append(set())
self.runq_hash.append("")