summaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-04-15 15:27:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-15 15:54:20 +0100
commit389a4ab300465f7e461eff52bc80646246c359d5 (patch)
tree446b86b2058ab60d8f8ebf70f2baeab7fcc2103d /lib/bb/data.py
parent0cfaa3457ca4ede0fdc5c4ac0404e3bbd3f8ebd9 (diff)
downloadbitbake-contrib-389a4ab300465f7e461eff52bc80646246c359d5.tar.gz
data: fix performance regression
BitBake commit 7c568132c54a21161de28907159f902462f1e2bb resulted in a fairly serious performance regression during parsing, almost doubling the time taken to do a full parse and almost certainly impacting performance during building. The expandKeys function is called frequently, and if we avoid using keys() and instead just use the normal variable lookup mechanism, performance is restored. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r--lib/bb/data.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 110666ca2..abf210aa6 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -158,9 +158,9 @@ def expandKeys(alterdata, readdata = None):
for key in todolist:
ekey = todolist[key]
- if ekey in keys(alterdata):
+ newval = alterdata.getVar(ekey, 0)
+ if newval:
val = alterdata.getVar(key, 0)
- newval = alterdata.getVar(ekey, 0)
if val is not None and newval is not None:
bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
alterdata.renameVar(key, ekey)