Wiki Navigation

Performance for yum

This is a page documenting benchmark results within yum, over various releases. Also some comparison to rpm/etc. There is no comparison to other package managers, because that's "much harder" and not that useful.

Quick summary for all versions

Note that this has been tested at somewhat random times, and features have been added so these aren't 1-1 comparable for what they are doing. Also sqlite/python changes have made a difference, as has the size of the repo metadata (as Fedora gets bigger). Also the same machine did not run 3.0.1 and 3.2.27+, so there are some HW differences (but that doesn't make a big difference for these things).
Also the "big lie" with benchmarks like this, for all packaging systems, is that we are operating on at least 200MB of data on disk so if an IO has to be done (first boot, or just not in page cache) the numbers are drastically different.

op

3.0.1 (2006-11-01)

3.2.1 (2007-06-21)

3.2.8+ (2007-12-03)

3.2.16+ (2008-02-27)

3.2.24+ (2009-09-28)

3.2.27+ (2010-06-04)

noop

0.3

0.4

4.5

0.9

0.6

0.4

noop-ts

n/a

n/a

n/a

n/a

0.6

0.6

list ustr

20.4

5.8

6.3

1.8

1

0.6

search ustr

23.3+-7

4.3

5.3

1.8

1.3

1.2

search python

18.2+-2

9.8

9.2

2.3

2.5

2.5

list python\*

28 +-6

6

6.4

1.9

1.4

1.1

Comparison between latest "yum list", repoquery --installed and rpm

Yum is never going to be faster than rpm, because we'll always be doing a bit more work. We can try to make the difference as small as possible though. This information tries to show how close we are, and where the extra time goes.

We don't want to measure gnome-terminal etc. time, so for -qa we'll pipe everything to "wc -l".

...as you can see running -qa is actually fractionally faster from the bindings.

Somewhat more realistic rpm-python

Obviously the above rpm-python code isn't really comparable with yum, as yum is an API and you can do many things with it. We can get somewhat closer by creating python "class" objects for each package in the rpmdb, sort them all and filter out the gpgkeys. And then print them:

...the first version does **nothing** but find the all the modules for the yum API. This is roughly equivalent to linking when compiling C (where it's then basically free at runtime), and is probably the main thing most people are thinking of if they say python is slow. The last version is minimal overhead for using the yum API, as this creates a single object and loads the main yum.conf configuration.

So if we take the r-p-api code and import yum, and use yum.packages.YumInstalledPackage?() in place of NPkg() we get:

yum

yum does a **lot** more work, including nicer layout and looking to see if packages have updates/etc. this affects huge output like "yum list installed" a lot. So there is significant overhead over plain repoquery:

Comparison between "yum install/remove", rpm

For a long time yum had been "much worse" than rpm for install/remove commands. Some of that was due to general fixes, but it also generally has got less love because any difference in speed was only really noticeable with small numbers of small packages (otherwise the I/O from the install/remove vastly outweighs any other part of the operation).

And again, yum has to do a non-trivial amount more work than plain rpm, as yum keeps a detailed history log and it's own yumdb.

These timings were performed on a virt-machine (against the "zint" package -- ~250k, runs ldconfig in %post and %postun):

command

version

operation

time (seconds)

rpm

4.8.1-2

install

2.0

rpm

4.8.1-2

remove

1.5

yum

3.2.25-1

install

7.0

yum

3.2.25-1

remove

5.5

yum

3.2.28-3

install

6.5

yum

3.2.28-3

remove

4.0

yum

3.2.28-8

install

4.0

yum

3.2.28-8

remove

3.0

yum

3.2.28-8

localinstall

3.2

yum (no history)

3.2.28-8

install

3.5

yum (no history)

3.2.28-8

remove

2.4

yum (no history)

3.2.28-8

localinstall

2.8

bare-rpm-python-erase.py

0

remove

1.0

echo no | yum

3.2.28-3

install

2.5

echo no | yum

3.2.28-3

remove

1.5

echo no | yum

3.2.28-8

install

1.5

echo no | yum

3.2.28-8

remove

0.5

echo no | yum

3.2.28-8

localinstall

0.6

...note that for all the operations except the "echo no" variants, there could be a non-trivial delay due to IO stalls.