Perhaps the commonest complaint about rpm is
rpm -qa is S-L-O-O-O-W!
with various wallclock measurements using time(1) that
just don't understand how RPM accesses an rpmdb, and
what operations are being performed.
Well, that's about to change.
I finally found enough time to figure the details of
1) creating a Nvra index with "name-version-release.arch" string keys.
2) writing an iterator that traverses solely the index without loading headers.
3) using DB_DBT_PARTIAL on a *RE string stem for partial record retrieval, with
full pattern match.
E.g. here's what I happen to have on my screen atm (with debugging spewage snipped):
[jbj@fedora10 rpmdb]$ rpm -qvv '^[pq]erl'
...
D: pool h: created size 216 limit -1 flags 0
perl-5.10.0-73.fc11.i586
perl-BSD-Resource-1.28-8.fc11.i586
perl-Compress-Raw-Zlib-2.008-82.fc11.i586
perl-Compress-Zlib-2.008-82.fc11.i586
perl-Date-Manip-5.54-2.fc11.noarch
perl-Error-0.17015-2.fc11.noarch
perl-ExtUtils-MakeMaker-6.36-82.fc11.i586
perl-ExtUtils-ParseXS-2.18-82.fc11.i586
perl-Git-1.6.2.5-1.fc11.noarch
perl-HTML-Parser-3.60-1.fc11.i586
perl-HTML-Tagset-3.20-2.fc11.noarch
perl-IO-Compress-Base-2.008-82.fc11.i586
perl-IO-Compress-Zlib-2.008-82.fc11.i586
perl-Module-Pluggable-3.90-82.fc11.i586
perl-Newt-1.08-22.fc11.i586
perl-Pod-Escapes-1.04-82.fc11.i586
perl-Pod-Simple-3.07-82.fc11.i586
perl-SGMLSpm-1.03ii-19.fc11.noarch
perl-String-CRC32-1.4-7.fc11.i586
perl-Test-Harness-3.16-82.fc11.i586
perl-URI-1.37-2.fc11.noarch
perl-XML-DOM-1.44-5.fc11.noarch
perl-XML-Parser-2.36-4.fc11.i586
perl-XML-RegExp-0.03-5.fc11.noarch
perl-devel-5.10.0-82.fc11.i586
perl-libs-5.10.0-82.fc11.i586
perl-libwww-perl-5.825-2.fc11.noarch
perl-version-0.74-82.fc11.i586
D: pool tsi: created size 24 limit -1 flags 0
...
I'll likely be able to get something checked in tonight,
and will do the usual time(1) benchmark metrics.
Note that _AT LEAST_ 3 orders of magnitude less data
needs to be processed to generate output, so I full expect
to muzzle complaints that start out
rpm -qa is S-L-O-O-O-W!
forevermore.
Here's what I expect to be able to _IMPROVE_ upon:
[jbj@fedora10 rpmdb]$ /usr/bin/time rpm -qvv '^[pq]erl'
...
0.08user 0.31system 0:00.88elapsed 44%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3697minor)pagefaults 0swaps
...
[jbj@fedora10 rpmdb]$ /usr/bin/time rpm -qa > /dev/null
0.04user 0.67system 0:00.83elapsed 85%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+64054minor)pagefaults 0swaps
Go ahead and argue whether 0.83 seconds is faster or slower than 0.88 seconds
all you want. Have fun!
73 de Jeff
- application/pkcs7-signature attachment: smime.p7s
Received on Sat Nov 21 21:04:00 2009