Bug 1537981

Summary: performance issue: dnf repomanage is really slow (60x slower than previous)
Product: [Fedora] Fedora Reporter: Remi Collet <fedora>
Component: dnf-plugins-coreAssignee: Marek Blaha <mblaha>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: carl, dmach, jmracek, mblaha, packaging-team-maint, paul, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-28 08:01:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Remi Collet 2018-01-24 08:57:25 UTC
Version-Release number of selected component (if applicable):
dnf-plugins-core-2.1.5-1.fc27.noarch

Running in a directory with ~5000 packages, to keep 5 recent versions (15 packages found)

$ time dnf repomanage --old --keep 5 /tmp/rpms
...
real	0m15,971s

Which seems really long (IIRC was really faster in previous version, i.e. in F25)


Just for fun, running a quirk and dirty test in PHP (wrapping rpmdev-vercmp)
time php repomanage.php

$ time php repomanage.php
...
real	0m5,124s

5" vs 16", there is obviously some possible performance improvement...

Comment 1 Remi Collet 2018-01-24 09:06:19 UTC
Another test, with same set of packages on RHEL 7

$ time repomanage --old --keep 5 .
...
real	0m5.519s

Comment 2 Marek Blaha 2018-01-24 12:54:48 UTC
At first sight there definitely are possibilities for performance improvement.
Please, are you able to do same test on F25?

Comment 3 Remi Collet 2018-01-24 13:09:08 UTC
(In reply to Marek Blaha from comment #2)
> At first sight there definitely are possibilities for performance
> improvement.
> Please, are you able to do same test on F25?

Yes (not on my physical machine, but on a small VM)

# time dnf repomanage --old --keep 5 /var/tmp/rpms/
...
real	0m0.269s

Comment 4 Remi Collet 2018-01-26 07:34:26 UTC
Just for fun, on fedora 27

# time repomanage --old --keep 5 /var/tmp/rpms/

Yum-utils package has been deprecated, use dnf instead.
See 'man yum2dnf' for more information.

...
real	0m0.258s

# time php repomanage.php -old --keep 5 /var/tmp/rpms/

Comment 5 Remi Collet 2018-01-26 07:43:11 UTC
# time php repomanage.php -old --keep 5 /var/tmp/rpms/
...
real	0m0,137s

Comment 7 Jaroslav Mracek 2018-06-28 08:01:16 UTC
The issue is solved by libdnf-0.15.1-1 that was released into rawhide.