summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-16 13:58:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-21 15:30:13 +0100
commitbb1e701fb150647227007c1cd4100cc91de311c1 (patch)
treee19ef72198a2aa1745d2125554adedcf6eaa2bd6 /bitbake/lib
parent4cc3c0daed392c2938abda523ec34400f852e819 (diff)
downloadpoky-bb1e701fb150647227007c1cd4100cc91de311c1.tar.gz
bitbake: runqueue: Optimise build_taskdepdata slightly
Rather than repeatedly calling mc_from_tid() do this in the parent, removing around a million function calls. Takes time spent in this function from 40s to 36s. (Bitbake rev: 28b3f0d8867804799420689c314ac4a8f01efb8c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/runqueue.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index a98ccddd09..4f69578e46 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -2160,12 +2160,11 @@ class RunQueueExecute:
2160 2160
2161 return True 2161 return True
2162 2162
2163 def filtermcdeps(self, task, deps): 2163 def filtermcdeps(self, task, mc, deps):
2164 ret = set() 2164 ret = set()
2165 mainmc = mc_from_tid(task)
2166 for dep in deps: 2165 for dep in deps:
2167 mc = mc_from_tid(dep) 2166 thismc = mc_from_tid(dep)
2168 if mc != mainmc: 2167 if thismc != mc:
2169 continue 2168 continue
2170 ret.add(dep) 2169 ret.add(dep)
2171 return ret 2170 return ret
@@ -2174,9 +2173,10 @@ class RunQueueExecute:
2174 # as most code can't handle them 2173 # as most code can't handle them
2175 def build_taskdepdata(self, task): 2174 def build_taskdepdata(self, task):
2176 taskdepdata = {} 2175 taskdepdata = {}
2176 mc = mc_from_tid(task)
2177 next = self.rqdata.runtaskentries[task].depends.copy() 2177 next = self.rqdata.runtaskentries[task].depends.copy()
2178 next.add(task) 2178 next.add(task)
2179 next = self.filtermcdeps(task, next) 2179 next = self.filtermcdeps(task, mc, next)
2180 while next: 2180 while next:
2181 additional = [] 2181 additional = []
2182 for revdep in next: 2182 for revdep in next:
@@ -2186,7 +2186,7 @@ class RunQueueExecute:
2186 provides = self.rqdata.dataCaches[mc].fn_provides[taskfn] 2186 provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
2187 taskhash = self.rqdata.runtaskentries[revdep].hash 2187 taskhash = self.rqdata.runtaskentries[revdep].hash
2188 unihash = self.rqdata.runtaskentries[revdep].unihash 2188 unihash = self.rqdata.runtaskentries[revdep].unihash
2189 deps = self.filtermcdeps(task, deps) 2189 deps = self.filtermcdeps(task, mc, deps)
2190 taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash, unihash] 2190 taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash, unihash]
2191 for revdep2 in deps: 2191 for revdep2 in deps:
2192 if revdep2 not in taskdepdata: 2192 if revdep2 not in taskdepdata: