All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "chris.laplante@agilent.com" <chris.laplante@agilent.com>,
	 "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: Re: Pickle vs. sqlite3 for cache?
Date: Tue, 20 Aug 2024 15:10:55 +0100	[thread overview]
Message-ID: <3c11c796ba2c91178e0b67d7bc3ce508618c2ffe.camel@linuxfoundation.org> (raw)
In-Reply-To: <DM8PR12MB5430C4D4EA06B2AD975C00928B8D2@DM8PR12MB5430.namprd12.prod.outlook.com>

On Tue, 2024-08-20 at 13:56 +0000, chris.laplante@agilent.com wrote:
> Apologies if this discussion has already happened (I searched the
> archives but couldn’t find anything), but I had a thought the other
> day. I wonder if the decision to use ‘pickle’ for bb_cache.dat still
> makes sense? BitBake performance has certainly been getting better
> over the years I’ve used it, however it still seems to spend an
> inordinate amount of time loading gigantic pickled data into memory.
> I wonder if it is time to dump pickle and consider sqlite3 instead?
>  
> Just wanted to get the discussion started, since there’s a chance
> there is some detail(s) I missed that will stop this idea cold :(.

I'd not be in favour of using sqlite here, it is not a good fit for
what we need. We've used it in other areas in bitbake in the past and
it never seemed to work too well. We're effectively storing python data
structures in the cache and having mappings in/out of sqlite is not
going to help performance.

We should probably have a look at what exactly is being stored in the
cache and using the most space as I strongly suspect there are ways to
optmise that. Interning strings was very effective in the past for
example as you then only have one copy of the string and everything
else is a reference to it.

Also, the hope was also that BB_SERVER_TIMEOUT (i.e. memory resident
bitbake) would avoid this pickle time in particular. I don't know how
effectively that is happening.

Right now, I think the priority needs to be to sort out the
"runcommand" async vs a sync command issues and clean up that area of
the API, then we can think more about performance.

Cheers,

Richard




  parent reply	other threads:[~2024-08-20 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 13:56 Pickle vs. sqlite3 for cache? chris.laplante
2024-08-20 14:07 ` [bitbake-devel] " Joshua Watt
2024-08-20 14:10 ` Richard Purdie [this message]
2024-08-20 14:19   ` chris.laplante

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=3c11c796ba2c91178e0b67d7bc3ce508618c2ffe.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=chris.laplante@agilent.com \
    /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.