diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-13 11:48:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-21 23:05:55 +0100 |
commit | b56918c7ef7913e84356c69ee9b269844a446728 (patch) | |
tree | 9a7eb010d121258b39c416e3cea49543ddad1d06 /lib/bb/parse/ast.py | |
parent | aa6448a0552ba2947ac262b8b5314a593d1058d3 (diff) | |
download | bitbake-b56918c7ef7913e84356c69ee9b269844a446728.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r-- | lib/bb/parse/ast.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py index d8c141b37..0ad6d5811 100644 --- a/lib/bb/parse/ast.py +++ b/lib/bb/parse/ast.py @@ -337,8 +337,10 @@ def finalize(fn, d, variant = None): bb.event.fire(bb.event.RecipeParsed(fn), d) -def _create_variants(datastores, names, function): +def _create_variants(datastores, names, function, onlyfinalise): def create_variant(name, orig_d, arg = None): + if onlyfinalise and name not in onlyfinalise: + return new_d = bb.data.createCopy(orig_d) function(arg or name, new_d) datastores[name] = new_d @@ -430,7 +432,7 @@ def multi_finalize(fn, d): except bb.parse.SkipPackage as e: d.setVar("__SKIPPED", e.args[0]) - _create_variants(datastores, versions, verfunc) + _create_variants(datastores, versions, verfunc, onlyfinalise) extended = d.getVar("BBCLASSEXTEND", True) or "" if extended: @@ -460,7 +462,7 @@ def multi_finalize(fn, d): bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d) safe_d.setVar("BBCLASSEXTEND", extended) - _create_variants(datastores, extendedmap.keys(), extendfunc) + _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise) for variant, variant_d in datastores.iteritems(): if variant: |