[tools] mrepo patches
Dag Wieers
dag at wieers.com
Sun Jul 22 13:03:57 CEST 2007
On Fri, 20 Jul 2007, 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)!
Yes, the reason I didn't want to use the internal Set implementation was
that it would not work on older implementations. Implementing Set using is
indeed much nicer.
> - 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 prefer to have it inside of the Repo-class. Couldn't we simply free
those data structures after using it ? I'm also wondering how much memory
each sucks up. I never worried about memory usage, but then again, I am
not using it for more than 4 or 5 distributions at a time.
Since people are reporting to run out of loop-devices, I can imagine that
memory-usages in those cases are entirely different :)
> I hope you'll find it useful and will consider including it in the next
> release...
I will definitely add the new Set implementation, not sure about the
rpm-lists move out of Repo-class. I have always disliked having temporary
variables that change depending on the context.
> 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...
I'm very much interested in that patch !
-- dag wieers, dag at wieers.com, http://dag.wieers.com/ --
[Any errors in spelling, tact or fact are transmission errors]
More information about the tools
mailing list