summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-02 09:02:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-03 10:12:42 +0000
commit34e4eebc32c4836fc40098e90b17c00f51398967 (patch)
tree20f3ba43c0341cbed8b454c92d60e0fc326b9d50 /bitbake/lib/bb/server
parent791d6e63be09b361dd3397707a0507399b9a9ce7 (diff)
downloadpoky-34e4eebc32c4836fc40098e90b17c00f51398967.tar.gz
bitbake: lib/bb: Fix string concatination potential performance issues
Python scales badly when concatinating strings in loops. Most of these references aren't problematic but at least one (in data.py) is probably a performance issue as the issue is compounded as strings become large. The way to handle this in python is to create lists which don't reconstruct all the objects when appending to them. We may as well fix all the references since it stops them being copy/pasted into something problematic in the future. This patch was based on issues highligthted by a report from AWS Codeguru. (Bitbake rev: d654139a833127b16274dca0ccbbab7e3bb33ed0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r--bitbake/lib/bb/server/process.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 8fdcc66dc7..1636616660 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -326,10 +326,10 @@ class ProcessServer():
326 if e.errno != errno.ENOENT: 326 if e.errno != errno.ENOENT:
327 raise 327 raise
328 328
329 msg = "Delaying shutdown due to active processes which appear to be holding bitbake.lock" 329 msg = ["Delaying shutdown due to active processes which appear to be holding bitbake.lock"]
330 if procs: 330 if procs:
331 msg += ":\n%s" % str(procs.decode("utf-8")) 331 msg.append(":\n%s" % str(procs.decode("utf-8")))
332 serverlog(msg) 332 serverlog("".join(msg))
333 333
334 def idle_commands(self, delay, fds=None): 334 def idle_commands(self, delay, fds=None):
335 nextsleep = delay 335 nextsleep = delay