aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-05-29 09:00:11 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-30 22:56:51 +0100
commitdf2c0ae146b5d9f82b15ab2eac988fe919175600 (patch)
tree0c9f1d91657b67152c576dce4d70c279445f84c2
parent3599293793816a7c5c9d0f296fb4bb96ea266f8d (diff)
downloadbitbake-contrib-stable/2.8-nut.tar.gz
siggen: Enable batching of unihash queriesstable/2.8-nutrpurdie/2.8
Uses the batching API of the client to reduce the effect of latency when making multiple queries to the server Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/siggen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 03dfda6f3..65ca0811d 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -726,10 +726,13 @@ class SignatureGeneratorUniHashMixIn(object):
return result
if self.max_parallel <= 1 or len(queries) <= 1:
- # No parallelism required. Make the query serially with the single client
+ # No parallelism required. Make the query using a single client
with self.client() as client:
- for tid, args in queries.items():
- query_result[tid] = client.get_unihash(*args)
+ keys = list(queries.keys())
+ unihashes = client.get_unihash_batch(queries[k] for k in keys)
+
+ for idx, k in enumerate(keys):
+ query_result[k] = unihashes[idx]
else:
with self.client_pool() as client_pool:
query_result = client_pool.get_unihashes(queries)