[Yum] yum performance

Dimitrios Apostolou jimis at gmx.net
Thu Aug 13 15:41:38 UTC 2009


On Thu, 13 Aug 2009, Dimitrios Apostolou wrote:

> Profiling after my changes seems that now the major slowdown is 
> simplePkgList()@rpmsack.py so it's worth concentrating the effort there.

I dug a little deeper on this one and am now certain that most CPU time is 
needed inside the dbMatch() iterator. Unfortunately this is as far as I 
can go since the whole rpm-python module is implemented in C. Nevertheless 
I'm wondering, why does a simple listing of ~2K packages needs about 5 
seconds. What format is the rpm database in? Wasn't there a big format 
change recently that improved the performance? Isn't "rpm -qa" the same as 
iterating over dbMatch() with no parameters? If so why there is so big 
difference:


$ time python yum/rpmsack.py >/dev/null

real	0m5.481s
user	0m3.568s
sys	0m1.222s


$ time rpm -qa > /dev/null

real	0m27.155s
user	0m22.924s
sys	0m1.506s


Thanks in advance,
Dimitris


P.S. In my previous email I forgot to mention that the usage of 
share_data()@misc.py is a slowdown since it is called many thousands 
times. Since it doesn't seem to provide an important memory advantage and 
it perplexes the code a lot, I have removed it wherever my patch applies. 
Indeed this saves some seconds of CPU time.





More information about the Yum mailing list