From 9bbf6f350d84900cd2852bb321edf9b7dbcdc642 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 15 Apr 2013 15:27:34 +0100 Subject: bitbake: 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. (Bitbake rev: 034b392e9877309f15940b258fc2c16f16fb40b5) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bitbake/lib/bb/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/data.py') diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 110666ca2b..abf210aa6b 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/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) -- cgit v1.2.3-54-g00ecf