Bug 451083 - pkgorder speed improvement
pkgorder speed improvement
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Martin Gracik
Alexander Todorov
Depends On:
  Show dependency treegraph
Reported: 2008-06-12 14:07 EDT by Dennis Gregorovic
Modified: 2013-07-04 08:46 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 05:55:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
remove repeated glob.glob calls (1.42 KB, patch)
2008-06-12 14:07 EDT, Dennis Gregorovic
no flags Details | Diff

  None (edit)
Description Dennis Gregorovic 2008-06-12 14:07:31 EDT
In pkgorder, the printMatchingPkgs method calls glob.glob many times.  This call
is a bit slow and, since the directory content shouldn't be changing, isn't
necessary.  I'll attach a patch that speeds up the script by a factor of 4x.
Comment 1 Dennis Gregorovic 2008-06-12 14:07:31 EDT
Created attachment 309118 [details]
remove repeated glob.glob calls
Comment 2 RHEL Product and Program Management 2009-02-03 18:14:19 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 4 Martin Gracik 2009-02-26 08:05:38 EST
Removed the glob.glob calls from printMatchingPkgs() function.
Now the script builds the package list just once outside of the function, and then uses fnmatch in the function to print the matching packages.
Tested on a custom repo, and it gives the same results as the original script, in 1/2 the time.
Will be available in version
Comment 6 Alexander Todorov 2009-05-11 08:10:14 EDT
with anaconda-runtime-
real    5m30.054s
user    5m22.683s
sys     0m7.009s

compared to 
real    6m5.938s
user    5m38.206s
sys     0m27.373s

on the same package set using pkgorder from 5.3. 

can we move this one to verified ?
Comment 7 Alexander Todorov 2009-05-29 09:33:13 EDT
can you provide some data from pkgorder execution? My test in comment #6 doesn't show big difference so I'm not sure if we want to move this to VERIFIED. 

Comment 8 Dennis Gregorovic 2009-05-29 13:03:13 EDT
For the 5.4 ppc Server tree with 5.4 anaconda, I get:

real    6m39.149s
user    5m7.330s
sys 0m31.468s

For the same tree with the 5.3 anaconda, I get:

real    9m24.324s
user    6m26.870s
sys 1m22.537s

So, I'm seeing about a 25% improvement.  I think we can close this bz and open a new one if we want to make other performance improvements.
Comment 9 Alexander Todorov 2009-06-01 03:02:13 EDT
Moving to VERIFIED as per comment #8
Comment 11 errata-xmlrpc 2009-09-02 05:55:50 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.