From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: bitbake/runqueue: Fix 'full' stamp checking to be more efficient and cache results
Date: Thu, 10 May 2012 08:47:05 +0100 [thread overview]
Message-ID: <1336636025.2494.117.camel@ted> (raw)
In-Reply-To: <CABcZANkdKjrx6hdYGLbjsxO-yfFQxZXXcTOuTfa-Xqh2c0VmgA@mail.gmail.com>
On Wed, 2012-05-09 at 17:03 -0700, Chris Larson wrote:
> On Wed, May 9, 2012 at 4:57 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> > index b870caf..48433be 100644
> > --- a/bitbake/lib/bb/runqueue.py
> > +++ b/bitbake/lib/bb/runqueue.py
> > @@ -875,7 +875,7 @@ class RunQueue:
> > bb.msg.fatal("RunQueue", "check_stamps fatal internal error")
> > return current
> >
> > - def check_stamp_task(self, task, taskname = None, recurse = False):
> > + def check_stamp_task(self, task, taskname = None, recurse = False, cache = {}):
>
> When people do this, it's typically a bug, but I presume you're doing
> it intentionally here? Use of mutable default values is often
> problematic due to their being shared across all calls to that
> function, but that's okay for a cache. Maybe you intended this, given
> it's a cache, but I wanted to ensure it was a conscious choice. Also,
> this adds yet another global cache with no form of invalidation /
> clear at all, it'll continue to grow through the lifetime of the
> process.
I'll change it to cache = None and then default it to {} in the code. I
agree infinitely growing caches in memory are not a good idea as we need
to avoid them as this could really screw up a UI doing re-execution.
Cheers,
Richard
next prev parent reply other threads:[~2012-05-10 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 23:57 bitbake/runqueue: Fix 'full' stamp checking to be more efficient and cache results Richard Purdie
2012-05-10 0:03 ` Chris Larson
2012-05-10 7:47 ` Richard Purdie [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-10 8:21 Richard Purdie
2012-05-10 13:54 ` Chris Larson
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=1336636025.2494.117.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.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.