mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
@@ -2160,12 +2160,11 @@ class RunQueueExecute:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def filtermcdeps(self, task, deps):
|
def filtermcdeps(self, task, mc, deps):
|
||||||
ret = set()
|
ret = set()
|
||||||
mainmc = mc_from_tid(task)
|
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
mc = mc_from_tid(dep)
|
thismc = mc_from_tid(dep)
|
||||||
if mc != mainmc:
|
if thismc != mc:
|
||||||
continue
|
continue
|
||||||
ret.add(dep)
|
ret.add(dep)
|
||||||
return ret
|
return ret
|
||||||
@@ -2174,9 +2173,10 @@ class RunQueueExecute:
|
|||||||
# as most code can't handle them
|
# as most code can't handle them
|
||||||
def build_taskdepdata(self, task):
|
def build_taskdepdata(self, task):
|
||||||
taskdepdata = {}
|
taskdepdata = {}
|
||||||
|
mc = mc_from_tid(task)
|
||||||
next = self.rqdata.runtaskentries[task].depends.copy()
|
next = self.rqdata.runtaskentries[task].depends.copy()
|
||||||
next.add(task)
|
next.add(task)
|
||||||
next = self.filtermcdeps(task, next)
|
next = self.filtermcdeps(task, mc, next)
|
||||||
while next:
|
while next:
|
||||||
additional = []
|
additional = []
|
||||||
for revdep in next:
|
for revdep in next:
|
||||||
@@ -2186,7 +2186,7 @@ class RunQueueExecute:
|
|||||||
provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
|
provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
|
||||||
taskhash = self.rqdata.runtaskentries[revdep].hash
|
taskhash = self.rqdata.runtaskentries[revdep].hash
|
||||||
unihash = self.rqdata.runtaskentries[revdep].unihash
|
unihash = self.rqdata.runtaskentries[revdep].unihash
|
||||||
deps = self.filtermcdeps(task, deps)
|
deps = self.filtermcdeps(task, mc, deps)
|
||||||
taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash, unihash]
|
taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash, unihash]
|
||||||
for revdep2 in deps:
|
for revdep2 in deps:
|
||||||
if revdep2 not in taskdepdata:
|
if revdep2 not in taskdepdata:
|
||||||
|
|||||||
Reference in New Issue
Block a user