Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 451083

Summary: pkgorder speed improvement
Product: Red Hat Enterprise Linux 5 Reporter: Dennis Gregorovic <dgregor>
Component: anacondaAssignee: Martin Gracik <mgracik>
Status: CLOSED ERRATA QA Contact: Alexander Todorov <atodorov>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: atodorov, borgan, ddumas, dmach
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 09:55:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
remove repeated glob.glob calls none

Description Dennis Gregorovic 2008-06-12 18:07:31 UTC
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 18:07:31 UTC
Created attachment 309118 [details]
remove repeated glob.glob calls

Comment 2 RHEL Product and Program Management 2009-02-03 23:14:19 UTC
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 13:05:38 UTC
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 12:10:14 UTC
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 13:33:13 UTC
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 17:03:13 UTC
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 07:02:13 UTC
Moving to VERIFIED as per comment #8

Comment 11 errata-xmlrpc 2009-09-02 09:55:50 UTC
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.