From 8f6b9c75a799e9005393bf06d945e2fb0634a265 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 31 Jan 2016 13:31:41 +0000 Subject: bitbake: 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. (Bitbake rev: b977faf59dc08050a44a16032fe52d1bbb80f2a1) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index a1182ef461..1f4174f77f 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf