From 77e56194dc8a81509b1977e1f329f91ce128a9c0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 7 Oct 2016 08:26:48 +0100 Subject: 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 --- bitbake/lib/bb/cooker.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') 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: 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) -- cgit v1.2.3-54-g00ecf