mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
bitbake: siggen: Batch unihash_exists checks
Similar to looking up unihashes, use the batch API when checking if a unihash exists to speed up lookups (Bitbake rev: 0ac521ff37b578f7487bca0eccc7dc9e5974991b) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
247d08ae07
commit
5a308474c2
@@ -671,20 +671,20 @@ class SignatureGeneratorUniHashMixIn(object):
|
||||
if len(query) == 0:
|
||||
return {}
|
||||
|
||||
uncached_query = {}
|
||||
query_keys = []
|
||||
result = {}
|
||||
for key, unihash in query.items():
|
||||
if unihash in self.unihash_exists_cache:
|
||||
result[key] = True
|
||||
else:
|
||||
uncached_query[key] = unihash
|
||||
query_keys.append(key)
|
||||
|
||||
with self.client() as client:
|
||||
uncached_result = {
|
||||
key: client.unihash_exists(value) for key, value in uncached_query.items()
|
||||
}
|
||||
if query_keys:
|
||||
with self.client() as client:
|
||||
query_result = client.unihash_exists_batch(query[k] for k in query_keys)
|
||||
|
||||
for key, exists in uncached_result.items():
|
||||
for idx, key in enumerate(query_keys):
|
||||
exists = query_result[idx]
|
||||
if exists:
|
||||
self.unihash_exists_cache.add(query[key])
|
||||
result[key] = exists
|
||||
|
||||
Reference in New Issue
Block a user