All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xu, Dongxiao" <dongxiao.xu@intel.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH 1/1] data_smart.py: make use of expand cache in getVar()
Date: Mon, 29 Aug 2011 21:15:47 +0800	[thread overview]
Message-ID: <D5AB6E638E5A3E4B8F4406B113A5A19A12D735D9CA@shsmsx501.ccr.corp.intel.com> (raw)
In-Reply-To: <1314623585.5939.295.camel@rex>

> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> Sent: Monday, August 29, 2011 9:13 PM
> To: Xu, Dongxiao
> Cc: bitbake-devel@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 21:07 +0800, Xu, Dongxiao wrote:
> > Hi Richard,
> >
> > > -----Original Message-----
> > > From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> > > Sent: Monday, August 29, 2011 8:55 PM
> > > To: Xu, Dongxiao
> > > Cc: bitbake-devel@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@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.
> 
> Good point.
> 
> I'm left wondering why we don't key that cache on the unexpanded value rather
> than a specific variable name (or name+flag).
> 
> I'll take this patch but its something we should consider...

Thanks, I will step into this point further and see if (name+flag) type of cache could benefit us more.

Thanks,
Dongxiao

> 
> Cheers,
> 
> Richard
> 
> 


  reply	other threads:[~2011-08-29 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29  7:33 [PATCH 0/1][PULL] bitbake: parsing time improvement Dongxiao Xu
2011-08-29  7:33 ` [PATCH 1/1] data_smart.py: make use of expand cache in getVar() Dongxiao Xu
2011-08-29 12:55   ` Richard Purdie
2011-08-29 13:07     ` Xu, Dongxiao
2011-08-29 13:13       ` Richard Purdie
2011-08-29 13:15         ` Xu, Dongxiao [this message]
2011-08-29 14:21         ` Xu, Dongxiao
2011-08-30 21:09           ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D5AB6E638E5A3E4B8F4406B113A5A19A12D735D9CA@shsmsx501.ccr.corp.intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.