aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-31 13:31:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-31 17:37:44 +0000
commitb977faf59dc08050a44a16032fe52d1bbb80f2a1 (patch)
tree6bdda2960e3b467c3e06c1c40477d9220595b970
parentd4989fb0355476de172169f0698757f7360e9a1f (diff)
downloadbitbake-b977faf59dc08050a44a16032fe52d1bbb80f2a1.tar.gz
cooker: Only start as many parse threads as we need
If we're only going to parse one recipe, no point in starting a large number of threads. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index a1182ef46..1f4174f77 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1986,8 +1986,6 @@ class CookerParser(object):
self.total = len(filelist)
self.current = 0
- self.num_processes = int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
- multiprocessing.cpu_count())
self.process_names = []
self.bb_cache = bb.cache.Cache(self.cfgdata, self.cfghash, cooker.caches_array)
@@ -2002,6 +2000,9 @@ class CookerParser(object):
self.toparse = self.total - len(self.fromcache)
self.progress_chunk = max(self.toparse / 100, 1)
+ self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
+ multiprocessing.cpu_count()), len(self.willparse))
+
self.start()
self.haveshutdown = False