* [PATCH] data: Move warning code to the first loop for performance
@ 2015-05-25 7:53 Richard Purdie
2015-05-26 9:56 ` Bernhard Reutner-Fischer
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2015-05-25 7:53 UTC (permalink / raw)
To: bitbake-devel
By doing this we can take advantage of the expansion cache before
starting write operations on the data store.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 82eefef..218998a 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -156,17 +156,17 @@ def expandKeys(alterdata, readdata = None):
if key == ekey:
continue
todolist[key] = ekey
+ newval = alterdata.getVar(ekey, 0)
+ if newval:
+ val = alterdata.getVar(key, 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))
# These two for loops are split for performance to maximise the
# usefulness of the expand cache
for key in todolist:
ekey = todolist[key]
- newval = alterdata.getVar(ekey, 0)
- if newval:
- val = alterdata.getVar(key, 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)
def inheritFromOS(d, savedenv, permitted):
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] data: Move warning code to the first loop for performance
2015-05-25 7:53 [PATCH] data: Move warning code to the first loop for performance Richard Purdie
@ 2015-05-26 9:56 ` Bernhard Reutner-Fischer
2015-05-26 9:59 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Reutner-Fischer @ 2015-05-26 9:56 UTC (permalink / raw)
To: Richard Purdie, bitbake-devel
On May 25, 2015 9:53:52 AM GMT+02:00, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
>By doing this we can take advantage of the expansion cache before
>starting write operations on the data store.
>
>Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
>diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
>index 82eefef..218998a 100644
>--- a/bitbake/lib/bb/data.py
>+++ b/bitbake/lib/bb/data.py
>@@ -156,17 +156,17 @@ def expandKeys(alterdata, readdata = None):
> if key == ekey:
> continue
> todolist[key] = ekey
>+ newval = alterdata.getVar(ekey, 0)
>+ if newval:
>+ val = alterdata.getVar(key, 0)
>+ if val is not None and newval is not None:
newval cannot ever be None in this if.
Thanks,
>+ bb.warn("Variable key %s (%s) replaces original key %s
>(%s)." % (key, val, ekey, newval))
>
> # These two for loops are split for performance to maximise the
> # usefulness of the expand cache
>
> for key in todolist:
> ekey = todolist[key]
>- newval = alterdata.getVar(ekey, 0)
>- if newval:
>- val = alterdata.getVar(key, 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)
>
> def inheritFromOS(d, savedenv, permitted):
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] data: Move warning code to the first loop for performance
2015-05-26 9:56 ` Bernhard Reutner-Fischer
@ 2015-05-26 9:59 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2015-05-26 9:59 UTC (permalink / raw)
To: Bernhard Reutner-Fischer; +Cc: bitbake-devel
On Tue, 2015-05-26 at 11:56 +0200, Bernhard Reutner-Fischer wrote:
> On May 25, 2015 9:53:52 AM GMT+02:00, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> >By doing this we can take advantage of the expansion cache before
> >starting write operations on the data store.
> >
> >Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> >
> >diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
> >index 82eefef..218998a 100644
> >--- a/bitbake/lib/bb/data.py
> >+++ b/bitbake/lib/bb/data.py
> >@@ -156,17 +156,17 @@ def expandKeys(alterdata, readdata = None):
> > if key == ekey:
> > continue
> > todolist[key] = ekey
> >+ newval = alterdata.getVar(ekey, 0)
> >+ if newval:
> >+ val = alterdata.getVar(key, 0)
> >+ if val is not None and newval is not None:
>
> newval cannot ever be None in this if.
True, to be fair I just moved the code although I probably was
responsible for the original too.
I'll tweak it, thanks.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-26 9:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-25 7:53 [PATCH] data: Move warning code to the first loop for performance Richard Purdie
2015-05-26 9:56 ` Bernhard Reutner-Fischer
2015-05-26 9:59 ` Richard Purdie
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.