From dfce2695b96ab587b8235cfab2859a874e9d2eef Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Mon, 29 Aug 2011 15:33:58 +0800 Subject: data_smart.py: make use of expand cache in getVar() Currently if passing expand=True to getVar() function, it will pass the handling to getVarFlag(), which doesn't get any benefit from the expand cache. Call the expand() function separately in getVar() to make use of the expand cache, which can decrease the parsing time by 40%. (from current 49s to 27s) (Bitbake rev: 6555a77c199f41bf35460138764e03e30c56d29f) Signed-off-by: Dongxiao Xu Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 301f9e3729..d8ba24ffd7 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -268,7 +268,12 @@ class DataSmart(MutableMapping): self.dict[var]["content"] = value def getVar(self, var, expand=False, noweakdefault=False): - return self.getVarFlag(var, "content", expand, noweakdefault) + value = self.getVarFlag(var, "content", False, noweakdefault) + + # Call expand() separately to make use of the expand cache + if expand and value: + return self.expand(value, var) + return value def renameVar(self, key, newkey): """ -- cgit v1.2.3-54-g00ecf