[Yum-devel] speeding up yum was Re: [Bug 207] yumError.py patch submissio

David Farning dfarning at sbcglobal.net
Thu Feb 26 15:40:37 UTC 2004


On Mon, 2004-02-23 at 10:42 -0700, Michael Stenner wrote:  
> As someone who does know C, let me say that I think it would be a
> terrible idea to write this in C. 

I am not sold that it is a terrible idea-- personally, the jury is still
out on if it just a bad idea;).  Ironically, some of the code is cleaner
using clearly defined structures.  It helps clean up the [{(),([])}}
type stuff yum has.  But, I fully agree using python lists are much
clearer building dynamic arrays or balanced trees while worrying about
mallocs and frees;)



> I would love to get the benefits of C here (speed is the only one I
> can think of really), but I don't think it's worth the sizable costs.

The bottlenecks that I found are:

download header.info --pretty short delay consider fixing by threading
or determining that the best header is already present.

download header -- oui, worked on in the metadata stuff.
verifying headers -- pretty short worked on in md


ts.addInstall(pkghdr,(pkghdr,rpmloc),'i') -- each of these calls to rpm
can take several seconds.  I need to look deeper, but is the problem
reading the header from the disk, sticking it into the rpmdb, or both.
Could consider using mmap() to cache the headers before use, conditional
on mem available.  

The big potential fix that I see here is not destroying and  rebuilding
the entire ts each iteration through resolvedep().  For example,

Running through resolvedeps(), ts.check() indicates that dependency is
not met.

Package is found that satisfies dependency.
package is added to the addInstallList (actually flag is set).

Now now entire ts is rebuilt and checked.

Why not just add the package to existing ts and check().  Situation were
the ts is rebuilt should be reduced to corner cases.

ts.check() -- no fix


Mean while, back in main--

tstest = clientStuff.create_final_ts(tsInfo)
clientStuff.tsTest(tstest)

If we have a proven good ts why create and test again? Remember making
and checking ts can take several seconds to several minutes!

tsfin = clientStuff.create_final_ts(tsInfo)
tsfin.check()
tsfin.order()
errors = tsfin.run(cb.callback, '')

Huh, we are making and checking it again!  

The goal should be to build only one ts!

Dave Farning




More information about the Yum-devel mailing list