mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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 <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
29c2cd4d54
commit
76a63bd031
@@ -726,10 +726,13 @@ class SignatureGeneratorUniHashMixIn(object):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
if self.max_parallel <= 1 or len(queries) <= 1:
|
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:
|
with self.client() as client:
|
||||||
for tid, args in queries.items():
|
keys = list(queries.keys())
|
||||||
query_result[tid] = client.get_unihash(*args)
|
unihashes = client.get_unihash_batch(queries[k] for k in keys)
|
||||||
|
|
||||||
|
for idx, k in enumerate(keys):
|
||||||
|
query_result[k] = unihashes[idx]
|
||||||
else:
|
else:
|
||||||
with self.client_pool() as client_pool:
|
with self.client_pool() as client_pool:
|
||||||
query_result = client_pool.get_unihashes(queries)
|
query_result = client_pool.get_unihashes(queries)
|
||||||
|
|||||||
Reference in New Issue
Block a user