[Rpm-maint] Feature request: Improved speed for 'rpm -qa'
liljencrantz at gmail.com
Tue Dec 19 13:17:34 UTC 2006
On 12/19/06, James Bowes <jbowes at redhat.com> wrote:
> Bill Nottingham wrote:
> > Turn off sig checking on queries (see /usr/lib/rpm/macros.)
> Looks like you can do the same with:
> rpm -qa --nosignature
> For for even more fun, try:
> rpm -qa --nosignature --nodigest
> Would it make sense for this to be the default behaviour? Either that,
> or document these options for query in the man page.
Thank you for the hints. This improves performance a lot:
On my modern system, the search time statys around 6 seconds on a cold
cache but goes down to around 0.5 seconds on a warm one. On my slow
system, the numbers are 22 seconds and 2 seconds, respectively. The
warm cache numbers are quite acceptable, but the cold cache numbers
are still worrying.
Performing a readahead on /var/lib/rpm/Packages seems to help a bit.
Cold cache times (including readahead) stays around 6 seconds on my
fast system, but falls from 22 seconds to 13 seconds on my slow system
by calling 'cat /var/lib/rpm/Packages' before calling 'rpm -qa'.
Waiting 6 seconds to perform tab completion on a modern system is
still a bit more than I'd like. I could add a script that performs a
readahead in the background when the user enters 'rpm' on the
commandline, but that solution feels a bit hackish. How hard would it
be to make 'rpm -qa' faster, possibly by specifying a search string
prefix like you can do with apt-cache, so that the entire databased
needn't be searched?
More information about the Rpm-maint