summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-14 12:51:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-15 09:04:38 +0000
commitde98cfe3cde4b8d5f4b163b5fba3f129651ef06a (patch)
tree9fef3674d4e59a0a381098deeeaec2753ce1eb8d
parent04e4e93efa4d8e2bdde950fe95c2fd95f89c13e7 (diff)
downloadopenembedded-core-contrib-de98cfe3cde4b8d5f4b163b5fba3f129651ef06a.tar.gz
sstatesig: Optimise get_taskhash for hashequiv
With hashequiv the get_taskhash function is called much more regularly and contains expensive operations. This these don't change based upon hash in a given build, improve the caching within the function to reduce overhead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/sstatesig.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index c566ce5a0c..8d009bfdc6 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -142,6 +142,13 @@ class SignatureGeneratorOEBasicHashMixIn(object):
def get_taskhash(self, tid, deps, dataCache):
h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache)
+ if tid in self.lockedhashes:
+ if self.lockedhashes[tid]:
+ return self.lockedhashes[tid]
+ else:
+ return h
+
+ h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache)
(mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid)
@@ -178,17 +185,19 @@ class SignatureGeneratorOEBasicHashMixIn(object):
% (recipename, task, h, h_locked, var))
return h_locked
+
+ self.lockedhashes[tid] = False
#bb.warn("%s %s %s" % (recipename, task, h))
return h
def get_unihash(self, tid):
- if tid in self.lockedhashes:
+ if tid in self.lockedhashes and self.lockedhashes[tid]:
return self.lockedhashes[tid]
return super().get_unihash(tid)
def dump_sigtask(self, fn, task, stampbase, runtime):
tid = fn + ":" + task
- if tid in self.lockedhashes:
+ if tid in self.lockedhashes and self.lockedhashes[tid]:
return
super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)