[tools] Re: mrepo patches

Alexander 'Leo' Bergolth leo at strike.wu-wien.ac.at
Fri Jul 20 20:14:45 CEST 2007


I guess I should also attach the patch... ;)
--leo

On 07/20/2007 08:13 PM, Alexander 'Leo' Bergolth wrote:
> I've done some patches for the current version (0.8.4) of mrepo.
> 
> The first patch does some cleanup:
> 
> - Most noticeable, it changes the Set-implementation of mrepo to use
> either the python-builtin set type or an equivalent implementation based
> on a dict. The current implementation using a list scales _very_ bad.
> Especially the current implementation of the difference() method, which
> uses two nested loops to iterate over both sets to compute the
> difference is O(n^2)!
> 
> This means that for example for the Fedora 7 Everything repository,
> which has around 7400 RPMs, the inner loop of the current implementation
> is evaluated more than 54 million times (if nothing has changed)! Since
> the difference is computed two times, we have 108 million comparisons
> vs. 14800 hash lookups of the new implementation. For the special "all"
> repository, of course, it is even worse.
> 
> - Another change is moving the rpm-lists newlist and oldlist out of the
> Repo-class into main(). The current implementation saves two rpmlists
> for each repository in memory, even though they are only needed for the
> currently processed repository during download.
> 
> I hope you'll find it useful and will consider including it in the next
> release...
> 
> An updated version of my incremental-symlink-syncing-patch and a set of
> unittests for the new functionality is in my queue and will follow
> shortly...
> 
> Cheers,
> --leo

-- 
e-mail   ::: Alexander.Bergolth (at) wu-wien.ac.at
fax      ::: +43-1-31336-906050
location ::: Computer Center | Vienna University of Economics | Austria

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mrepo-patch1.diff
Type: text/x-patch
Size: 6430 bytes
Desc: not available
Url : http://lists.rpmforge.net/pipermail/tools/attachments/20070720/56ed226d/mrepo-patch1.bin


More information about the tools mailing list