summaryrefslogtreecommitdiffstats
path: root/bitbake/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-09 12:33:26 +0100
commit77e56194dc8a81509b1977e1f329f91ce128a9c0 (patch)
treec38550c7106a48ff73c3df6c45422a657492d5d3 /bitbake/lib/bb/cooker.py
parent146eb22b0e7b77bf3b3dcd750b4124b6cb27f090 (diff)
downloadpoky-77e56194dc8a81509b1977e1f329f91ce128a9c0.tar.gz
bitbake: 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. (Bitbake rev: 1bf2ef874fbe47f1320007efa0bdeef8d630b8a1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 934072c44f..42831e2771 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -748,8 +748,7 @@ class BBCooker:
748 depend_tree['providermap'][name] = (pn, version) 748 depend_tree['providermap'][name] = (pn, version)
749 749
750 for tid in rq.rqdata.runtaskentries: 750 for tid in rq.rqdata.runtaskentries:
751 (mc, fn, taskname) = bb.runqueue.split_tid(tid) 751 (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
752 taskfn = bb.runqueue.taskfn_fromtid(tid)
753 pn = self.recipecaches[mc].pkg_fn[taskfn] 752 pn = self.recipecaches[mc].pkg_fn[taskfn]
754 pn = self.add_mc_prefix(mc, pn) 753 pn = self.add_mc_prefix(mc, pn)
755 version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[taskfn] 754 version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[taskfn]
@@ -772,8 +771,7 @@ class BBCooker:
772 771
773 772
774 for dep in rq.rqdata.runtaskentries[tid].depends: 773 for dep in rq.rqdata.runtaskentries[tid].depends:
775 (depmc, depfn, deptaskname) = bb.runqueue.split_tid(dep) 774 (depmc, depfn, deptaskname, deptaskfn) = bb.runqueue.split_tid_mcfn(dep)
776 deptaskfn = bb.runqueue.taskfn_fromtid(dep)
777 deppn = self.recipecaches[mc].pkg_fn[deptaskfn] 775 deppn = self.recipecaches[mc].pkg_fn[deptaskfn]
778 dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(tid)) 776 dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(tid))
779 if not dotname in depend_tree["tdepends"]: 777 if not dotname in depend_tree["tdepends"]:
@@ -843,8 +841,7 @@ class BBCooker:
843 tids.append(tid) 841 tids.append(tid)
844 842
845 for tid in tids: 843 for tid in tids:
846 (mc, fn, taskname) = bb.runqueue.split_tid(tid) 844 (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
847 taskfn = bb.runqueue.taskfn_fromtid(tid)
848 845
849 pn = self.recipecaches[mc].pkg_fn[taskfn] 846 pn = self.recipecaches[mc].pkg_fn[taskfn]
850 pn = self.add_mc_prefix(mc, pn) 847 pn = self.add_mc_prefix(mc, pn)