summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-05-29 09:00:11 -0600
committerSteve Sakoman <steve@sakoman.com>2024-06-06 06:53:49 -0700
commit83793ccd865e3e72563e6d5733b6bd02943feb8a (patch)
treebb3cf227e6d6810a0d15759311a202afae42eb16 /bitbake
parent934c533196bbe8d3ae51499f1326f26d94a7095f (diff)
downloadpoky-83793ccd865e3e72563e6d5733b6bd02943feb8a.tar.gz
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: fdac31655fb5441139f70e50292dbb5774cfdafe) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/siggen.py9
1 files changed, 6 insertions, 3 deletions
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):
726 return result 726 return result
727 727
728 if self.max_parallel <= 1 or len(queries) <= 1: 728 if self.max_parallel <= 1 or len(queries) <= 1:
729 # No parallelism required. Make the query serially with the single client 729 # No parallelism required. Make the query using a single client
730 with self.client() as client: 730 with self.client() as client:
731 for tid, args in queries.items(): 731 keys = list(queries.keys())
732 query_result[tid] = client.get_unihash(*args) 732 unihashes = client.get_unihash_batch(queries[k] for k in keys)
733
734 for idx, k in enumerate(keys):
735 query_result[k] = unihashes[idx]
733 else: 736 else:
734 with self.client_pool() as client_pool: 737 with self.client_pool() as client_pool:
735 query_result = client_pool.get_unihashes(queries) 738 query_result = client_pool.get_unihashes(queries)