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 - pkgorder speed improvement
Summary: pkgorder speed improvement
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda
Version: 5.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Martin Gracik
QA Contact: Alexander Todorov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-12 18:07 UTC by Dennis Gregorovic
Modified: 2013-07-04 12:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 09:55:50 UTC


Attachments (Terms of Use)
remove repeated glob.glob calls (deleted)
2008-06-12 18:07 UTC, Dennis Gregorovic
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1306 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2009-09-01 10:20:11 UTC

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
release.

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 11.1.2.169.

Comment 6 Alexander Todorov 2009-05-11 12:10:14 UTC
with anaconda-runtime-11.1.2.172-1
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
Dennis,
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. 

Thanks!

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.

http://rhn.redhat.com/errata/RHBA-2009-1306.html


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