diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2011-08-29 15:33:58 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-29 14:13:34 +0100 |
commit | dfce2695b96ab587b8235cfab2859a874e9d2eef (patch) | |
tree | 4ecfca088f7d966de0b3b755903b77a6bdb772ed /bitbake/lib | |
parent | 5d75eb27398ba65de8510c4be53c51966d4548be (diff) | |
download | poky-dfce2695b96ab587b8235cfab2859a874e9d2eef.tar.gz |
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 <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 7 |
1 files changed, 6 insertions, 1 deletions
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): | |||
268 | self.dict[var]["content"] = value | 268 | self.dict[var]["content"] = value |
269 | 269 | ||
270 | def getVar(self, var, expand=False, noweakdefault=False): | 270 | def getVar(self, var, expand=False, noweakdefault=False): |
271 | return self.getVarFlag(var, "content", expand, noweakdefault) | 271 | value = self.getVarFlag(var, "content", False, noweakdefault) |
272 | |||
273 | # Call expand() separately to make use of the expand cache | ||
274 | if expand and value: | ||
275 | return self.expand(value, var) | ||
276 | return value | ||
272 | 277 | ||
273 | def renameVar(self, key, newkey): | 278 | def renameVar(self, key, newkey): |
274 | """ | 279 | """ |