Patchwork [bitbake-devel,13/16] data: Optimise flag lookup in build_dependencies

login
register
mail settings
Submitter Richard Purdie
Date Sept. 16, 2013, 9:53 p.m.
Message ID <1379368413-9808-13-git-send-email-richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/58205/
State Accepted
Commit 1bf3aee698ad35f6815ea2c75471a96511a29d55
Headers show

Comments

Richard Purdie - Sept. 16, 2013, 9:53 p.m.
When looking up flag variable dependencies, large chunks of the function
aren't needed. Optimise the function flow accordingly for speed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/data.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/bb/data.py b/lib/bb/data.py
index 876f6ca..49bb5e9 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -291,10 +291,13 @@  def build_dependencies(key, keys, shelldeps, vardepvals, d):
         if key[-1] == ']':
             vf = key[:-1].split('[')
             value = d.getVarFlag(vf[0], vf[1], False)
-        else:
-            value = d.getVar(key, False)
+            parser = d.expandWithRefs(value, key)
+            deps |= parser.references
+            deps = deps | (keys & parser.execs)
+            return deps, value
         varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude"]) or {}
         vardeps = varflags.get("vardeps")
+        value = d.getVar(key, False)
 
         if "vardepvalue" in varflags:
            value = varflags.get("vardepvalue")