[pacman-dev] pacman -Qs first-run performance
hollunder at lavabit.com
Thu Sep 1 13:57:21 EDT 2011
Excerpts from Karol Blazewicz's message of 2011-09-01 19:38:32 +0200:
> On Thu, Sep 1, 2011 at 7:33 PM, Philipp <hollunder at lavabit.com> wrote:
> > Hi there,
> > pacman works very well for me, with one exception: searching for
> > installed packages. For me a -Ss takes about 5 seconds, a -Qs 25
> > seconds. I also noticed that this seems to be true for the first search
> > run only, the following ones are less than a second, no matter whether
> > it's a repo or local search. But if you want to just quickly find out a
> > thing, 25 seconds or so is a long time.
> > Anyway, I had a very brief look at the code and am far from
> > understanding it, but I think libalpm/db.c handles the search, the
> > package names, descriptions, etc. are stored in a linked list of
> > structs, the whole thing is cached in memory only and regex wizardry
> > is used for the search. If that's true, the bottleneck I experience is
> > the caching.
> > 5 seconds for -Ss is acceptable for me, but I wonder whether there's a
> > reasonably easy way to improve the 25 seconds of -Qs.
> > My knowledge of pacman internals is non-existant and my C skills are
> > minimal, so I don't think I can be a lot of help with this one, but
> > maybe there's something else I can be of help with instead.
> > Best regards,
> > Philipp
> I'm getting 10s -Qs first-time searches, what harddrive are you using??
It's a normal laptop HD, Hitachi HTS54321, 160GB, 5400 rpm.
It's really kind of weird that the web search takes longer than the
local search, intuition dictates it should be the other way around.
More information about the pacman-dev