[bitbake-devel] [PATCH 1/1] data_smart.py: make use of expand cache in getVar()

Xu, Dongxiao dongxiao.xu at intel.com
Mon Aug 29 13:07:40 UTC 2011


Hi Richard,

> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie at linuxfoundation.org]
> Sent: Monday, August 29, 2011 8:55 PM
> To: Xu, Dongxiao
> Cc: bitbake-devel at lists.openembedded.org
> Subject: Re: [bitbake-devel] [PATCH 1/1] data_smart.py: make use of expand
> cache in getVar()
> 
> On Mon, 2011-08-29 at 15:33 +0800, Dongxiao Xu wrote:
> > 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)
> >
> > Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
> > ---
> >  lib/bb/data_smart.py |    7 ++++++-
> >  1 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index
> > 301f9e3..d8ba24f 100644
> > --- a/lib/bb/data_smart.py
> > +++ b/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
> >
> 
> Why can't we have getVarFlag use the expand cache?

For expand cache, the format is a list: expand_cache[varname].
It doesn't contain information of flag values.

Thanks,
Dongxiao

> 
> Cheers,
> 
> Richard



More information about the bitbake-devel mailing list