summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-05-30 09:41:27 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-31 16:56:25 +0100
commit5a308474c21a44e22a3cc8e23a9a41269cb51266 (patch)
treefde9b5f1a7a778c2a8af04c3fe6d9ae962838f55
parent247d08ae0765fdd73f80e7608f76e36983e2109d (diff)
downloadpoky-5a308474c21a44e22a3cc8e23a9a41269cb51266.tar.gz
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>
-rw-r--r--bitbake/lib/bb/siggen.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 79f347db30..92066da00c 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -671,20 +671,20 @@ class SignatureGeneratorUniHashMixIn(object):
671 if len(query) == 0: 671 if len(query) == 0:
672 return {} 672 return {}
673 673
674 uncached_query = {} 674 query_keys = []
675 result = {} 675 result = {}
676 for key, unihash in query.items(): 676 for key, unihash in query.items():
677 if unihash in self.unihash_exists_cache: 677 if unihash in self.unihash_exists_cache:
678 result[key] = True 678 result[key] = True
679 else: 679 else:
680 uncached_query[key] = unihash 680 query_keys.append(key)
681 681
682 with self.client() as client: 682 if query_keys:
683 uncached_result = { 683 with self.client() as client:
684 key: client.unihash_exists(value) for key, value in uncached_query.items() 684 query_result = client.unihash_exists_batch(query[k] for k in query_keys)
685 }
686 685
687 for key, exists in uncached_result.items(): 686 for idx, key in enumerate(query_keys):
687 exists = query_result[idx]
688 if exists: 688 if exists:
689 self.unihash_exists_cache.add(query[key]) 689 self.unihash_exists_cache.add(query[key])
690 result[key] = exists 690 result[key] = exists