summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-19 21:40:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-21 12:16:28 +0000
commitb97de63d2feaeb7710b7550dfc4144f41f5c8fc6 (patch)
treeed3673734aa1d774922a632e815b52a5ab976885
parent17f1b80c0619a7648a63cd7be597215ef1e39c60 (diff)
downloadpoky-b97de63d2feaeb7710b7550dfc4144f41f5c8fc6.tar.gz
bitbake: bitbake-worker: Improve bytearray truncation performance
If there are large amounts of data being transferred to the cooker from the worker, recreating the bytearray becomes inefficient as it happens for every pipesize block of data, defaulting to 64kb. Instead we can use the deletion API for bytearrays to make this more efficient and avoid the object recreation. We noticed this with a strace ptest image taking days to complete the build after having 6GB of data in the testimage log. Whilst there are other issues there, making this code more efficient doesn't hurt. (Bitbake rev: a4a72b7edb368f352784c856a647236a887010dd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/bin/bitbake-worker2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index e8073f2ac3..a8a9660c5f 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -105,7 +105,7 @@ def worker_flush(worker_queue):
105 if not worker_queue.empty(): 105 if not worker_queue.empty():
106 worker_queue_int.extend(worker_queue.get()) 106 worker_queue_int.extend(worker_queue.get())
107 written = os.write(worker_pipe, worker_queue_int) 107 written = os.write(worker_pipe, worker_queue_int)
108 worker_queue_int = worker_queue_int[written:] 108 del worker_queue_int[0:written]
109 except (IOError, OSError) as e: 109 except (IOError, OSError) as e:
110 if e.errno != errno.EAGAIN and e.errno != errno.EPIPE: 110 if e.errno != errno.EAGAIN and e.errno != errno.EPIPE:
111 raise 111 raise