[oe-commits] [bitbake] 03/05: bitbake: siggen: Cache unihash values to avoid cache lookup
git at git.openembedded.org
git at git.openembedded.org
Thu Feb 6 22:50:26 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 367d41709483de22b9e9ba6f998d7584123450cb
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Dec 14 18:17:01 2019 +0000
bitbake: siggen: Cache unihash values to avoid cache lookup
Add unihash cache of values to speed up cache lookup.
(Bitbake rev: cb4eba0ff6b5702971a870c5d22bcdf74e015658)
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/siggen.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 5e66eae..36da00d 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -40,6 +40,7 @@ class SignatureGenerator(object):
def __init__(self, data):
self.basehash = {}
self.taskhash = {}
+ self.unihash = {}
self.runtaskdeps = {}
self.file_checksum_values = {}
self.taints = {}
@@ -80,19 +81,19 @@ class SignatureGenerator(object):
return
def get_taskdata(self):
- return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes, self.tidtopn, self.setscenetasks)
+ return (self.runtaskdeps, self.taskhash, self.unihash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes, self.tidtopn, self.setscenetasks)
def set_taskdata(self, data):
- self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes, self.tidtopn, self.setscenetasks = data
+ self.runtaskdeps, self.taskhash, self.unihash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes, self.tidtopn, self.setscenetasks = data
def reset(self, data):
self.__init__(data)
def get_taskhashes(self):
- return self.taskhash, self.unitaskhashes, self.tidtopn
+ return self.taskhash, self.unihash, self.unitaskhashes, self.tidtopn
def set_taskhashes(self, hashes):
- self.taskhash, self.unitaskhashes, self.tidtopn = hashes
+ self.taskhash, self.unihash, self.unitaskhashes, self.tidtopn = hashes
def save_unitaskhashes(self):
return
@@ -108,6 +109,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
def __init__(self, data):
self.basehash = {}
self.taskhash = {}
+ self.unihash = {}
self.taskdeps = {}
self.runtaskdeps = {}
self.file_checksum_values = {}
@@ -256,7 +258,13 @@ class SignatureGeneratorBasic(SignatureGenerator):
data = self.basehash[tid]
for dep in self.runtaskdeps[tid]:
- data = data + self.get_unihash(dep)
+ if dep in self.unihash:
+ if self.unihash[dep] is None:
+ data = data + self.taskhash[dep]
+ else:
+ data = data + self.unihash[dep]
+ else:
+ data = data + self.get_unihash(dep)
for (f, cs) in self.file_checksum_values[tid]:
if cs:
@@ -426,6 +434,7 @@ class SignatureGeneratorUniHashMixIn(object):
def set_unihash(self, tid, unihash):
key = self.tidtopn[tid] + ":" + bb.runqueue.taskname_from_tid(tid)
self.unitaskhashes[key] = (self.taskhash[tid], unihash)
+ self.unihash[tid] = unihash
def _get_unihash(self, tid, checkkey=None):
if tid not in self.tidtopn:
@@ -445,12 +454,14 @@ class SignatureGeneratorUniHashMixIn(object):
# If its not a setscene task we can return
if self.setscenetasks and tid not in self.setscenetasks:
+ self.unihash[tid] = None
return taskhash
# TODO: This cache can grow unbounded. It probably only needs to keep
# for each task
unihash = self._get_unihash(tid)
if unihash is not None:
+ self.unihash[tid] = unihash
return unihash
# In the absence of being able to discover a unique hash from the
@@ -485,6 +496,7 @@ class SignatureGeneratorUniHashMixIn(object):
bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e)))
self.set_unihash(tid, unihash)
+ self.unihash[tid] = unihash
return unihash
def report_unihash(self, path, task, d):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list