summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-13 11:48:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-23 11:43:29 +0100
commit249a24eee07f672c61964e0879a6d08399cdd8ac (patch)
treed4768e26d7a10276871712e3258a0c966e3d0960 /bitbake/lib/bb/parse
parent39c5cfbef79edd4439321c5776de97ad4e9b8420 (diff)
downloadpoky-249a24eee07f672c61964e0879a6d08399cdd8ac.tar.gz
bitbake: parse/ast: Optimise data finalisation
The optimisation where only the data we're interested in was finalised was good but it turns out we can do better. In the case where a class-extension is to be targeted, we can skip the other targets. This change does that and speeds up parsing at the bitbake-worker execution time. Specifically, you can see an improvement in the speed of bitbake X -n. (Bitbake rev: b56918c7ef7913e84356c69ee9b269844a446728) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/ast.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index d8c141b37c..0ad6d5811d 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -337,8 +337,10 @@ def finalize(fn, d, variant = None):
337 337
338 bb.event.fire(bb.event.RecipeParsed(fn), d) 338 bb.event.fire(bb.event.RecipeParsed(fn), d)
339 339
340def _create_variants(datastores, names, function): 340def _create_variants(datastores, names, function, onlyfinalise):
341 def create_variant(name, orig_d, arg = None): 341 def create_variant(name, orig_d, arg = None):
342 if onlyfinalise and name not in onlyfinalise:
343 return
342 new_d = bb.data.createCopy(orig_d) 344 new_d = bb.data.createCopy(orig_d)
343 function(arg or name, new_d) 345 function(arg or name, new_d)
344 datastores[name] = new_d 346 datastores[name] = new_d
@@ -430,7 +432,7 @@ def multi_finalize(fn, d):
430 except bb.parse.SkipPackage as e: 432 except bb.parse.SkipPackage as e:
431 d.setVar("__SKIPPED", e.args[0]) 433 d.setVar("__SKIPPED", e.args[0])
432 434
433 _create_variants(datastores, versions, verfunc) 435 _create_variants(datastores, versions, verfunc, onlyfinalise)
434 436
435 extended = d.getVar("BBCLASSEXTEND", True) or "" 437 extended = d.getVar("BBCLASSEXTEND", True) or ""
436 if extended: 438 if extended:
@@ -460,7 +462,7 @@ def multi_finalize(fn, d):
460 bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d) 462 bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d)
461 463
462 safe_d.setVar("BBCLASSEXTEND", extended) 464 safe_d.setVar("BBCLASSEXTEND", extended)
463 _create_variants(datastores, extendedmap.keys(), extendfunc) 465 _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise)
464 466
465 for variant, variant_d in datastores.iteritems(): 467 for variant, variant_d in datastores.iteritems():
466 if variant: 468 if variant: