diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2024-05-29 09:00:11 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-30 07:38:10 +0100 |
commit | 76a63bd031d923b0dc97ee34ae2faf595bbb98ae (patch) | |
tree | 08151e194a121d5c0d8d9beb9a87083b46c91621 /bitbake/lib/bb | |
parent | 29c2cd4d5478fafe16c844c291b35057f2cb7eda (diff) | |
download | poky-76a63bd031d923b0dc97ee34ae2faf595bbb98ae.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: a54734b4ac2ddb3bce004e576cf74d6ad6caf62a)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 9 |
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) |