Re: up to 25% reduction in runtime of `dpkg -S'
Richard Kettlewell writes ("up to 25% reduction in runtime of `dpkg -S'"):
> (There would appear to be situations in which it can be called more
> often than that, which I don't fully understand yet, but I don't think
> they're immediately relevant.)
You're right, they're not. (That is, they might happen and be
required for correctness of the output, but your patch doesn't break
> I have a modified dpkg in which `dpkg -S' does not parse the available
> file. I get a speed improvement of 25% when searching for a single
> file and almost 20% when searching for all files. Here are my
Your patch looks good to me; I have applied it to my tree.
> If I have missed some crucial fact about the implementation that means
> that the `available' file must be parsed, then I offer my apologies in
> advance, and would point out that I haven't had any breakfast yet.
Who needs breakfast when there is coffee.
FYI, I think you can also add msdbrw_noavail in the --assert-*
functions, which might well speed them up enourmously. I've done this
in my tree, but the patch wouldn't be compatible with the NMU series.
If an NMUer who applies RJK's patch would like to do the same there,
please go ahead.