[packagekit] Questions for PK and future zypp backend development
Richard Hughes
hughsient at gmail.com
Thu Jan 10 14:56:32 PST 2008
On Thu, 2008-01-10 at 22:53 +0000, Thomas Wood wrote:
> On Thu, 2008-01-10 at 15:09 -0700, Boyd Timothy wrote:
> > Hey everyone,
> [...]
> >
> > 1) Stateless backends?
> >
> > It appears that for almost every call, a new instance of zypp is
> > instantiated. This may not seem too bad, but the problem is that I'm
> > having to do so much setup work in the first place to make even simple
> > calls to find out information about a package. Some of this is being
> > worked on in libzypp right now, but I wondered if there's a better way
> > to maybe persist or reuse a currently instantiated zypp backend. I
> > read through the discussion about the yum backend and it seems writing
> > up my own caching scheme in the zypp backend might be a bad idea...but
> > at least it would speed things up some and help keep state.
>
> I would second this concern. For the Ipkg backend, the init procedure
> has to read and parse all configuration files and set up the hash tables
> for the package lists. If this is done every time a command is issued it
> may cause serious performance issues on embedded devices. This can be
> avoided with a few static variables to check for a previous init, but
> it'd be nice to have some sort of consideration for this built into
> PackageKit.
Sure, see my other mail. Note ipkg and others are slightly different as
threaded so we have to tread a bit more carefully.
> I also noticed that the PackageKit daemon calls backend_init when it
> first starts up, but also on each subsequent command. Is there any
> particular reason for this?
Well, that's designed as an "init, assuming you are doing one thing and
then closing down" i.e. open databases and lock. We probably need two
init levels, one for a per-command "locking and stuff" and one for a
per-invocation (with the databases and caches) step.
Richard.
More information about the PackageKit
mailing list