From 76a63bd031d923b0dc97ee34ae2faf595bbb98ae Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Wed, 29 May 2024 09:00:11 -0600 Subject: bitbake: siggen: Enable batching of unihash queries Uses the batching API of the client to reduce the effect of latency when making multiple queries to the server (Bitbake rev: a54734b4ac2ddb3bce004e576cf74d6ad6caf62a) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- bitbake/lib/bb/siggen.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 03dfda6f3c..65ca0811d5 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/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) -- cgit v1.2.3-54-g00ecf