summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-07 08:26:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-07 16:42:49 +0100
commit1bf2ef874fbe47f1320007efa0bdeef8d630b8a1 (patch)
treef4cf472678e8d9a04b5030c0a267090841c512c4 /lib/bb/cooker.py
parent858ade277d3bd62e84d3d78e9302f766c1b31dfb (diff)
downloadbitbake-contrib-1bf2ef874fbe47f1320007efa0bdeef8d630b8a1.tar.gz
runqueue: Optimise task id string manipulations
Some task id manipulations were suboptimal: * taskfn_fromtid and fn_from_tid were effectively the same function * many calls to split_tid(), then taskfn_fromtid() * taskfn_fromtid() called split_tid() internally This patch adds split_tid_mcfn() to replace split_tid() and returns the "taskfn" variant being used in many places. We update all core calls to the new function and ignore the return values we don't need since the function call overhead of the split_tid wrapper is higher than ignoring a return value. The one remaining standalone use of taskfn_fromtid is replaced with fn_from_tid. I couldn't see any external usage so it was dropped. There is external usage of split_tid so a wrapper remains for it. Combined together these changes should improve some of the runqueue task manipulation performance. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 934072c44..42831e277 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -748,8 +748,7 @@ class BBCooker:
depend_tree['providermap'][name] = (pn, version)
for tid in rq.rqdata.runtaskentries:
- (mc, fn, taskname) = bb.runqueue.split_tid(tid)
- taskfn = bb.runqueue.taskfn_fromtid(tid)
+ (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
pn = self.recipecaches[mc].pkg_fn[taskfn]
pn = self.add_mc_prefix(mc, pn)
version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[taskfn]
@@ -772,8 +771,7 @@ class BBCooker:
for dep in rq.rqdata.runtaskentries[tid].depends:
- (depmc, depfn, deptaskname) = bb.runqueue.split_tid(dep)
- deptaskfn = bb.runqueue.taskfn_fromtid(dep)
+ (depmc, depfn, deptaskname, deptaskfn) = bb.runqueue.split_tid_mcfn(dep)
deppn = self.recipecaches[mc].pkg_fn[deptaskfn]
dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(tid))
if not dotname in depend_tree["tdepends"]:
@@ -843,8 +841,7 @@ class BBCooker:
tids.append(tid)
for tid in tids:
- (mc, fn, taskname) = bb.runqueue.split_tid(tid)
- taskfn = bb.runqueue.taskfn_fromtid(tid)
+ (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
pn = self.recipecaches[mc].pkg_fn[taskfn]
pn = self.add_mc_prefix(mc, pn)