[Yum-devel] optimizations on package object creation and other things.
Florian Festi
ffesti at redhat.com
Wed Feb 28 09:54:10 UTC 2007
seth vidal wrote:
> If you've been watching the commits list you've seen James and I
> checking in a various items. Specifically we've been fixing a number of
> hurky things.
>
> Some useful comparisons:
> yum list available:
> 3.1.2: 11.9s
> HEAD: 7.3s
>
> yum search foo:
> 3.1.2: 43.4s
> HEAD: 2.7s
>
> yum install zvbi (single package, nothing fancy) (clean packages was run
> b/t runs)
> 3.1.2: 14.4s
> HEAD: 9.5s
>
>
> I know this is just measured in seconds but trimming out some of the
> class creation and streamlining the sqlite selects has helped. I'm
> curious about other places where we can trim out some more time. Where
> are we seeing hangs and delays the most?
Hi!
Having a look at the new depsolver there is still a lot room for improvement
(Yes, I am aware that optimizing the depsolver has been postponed until it
works correctly). Among some very obvious stuff that can be done with
standard techniques like dynamic programming I found something more complicated:
_checkRemove() treats files as provides. This is correct and needed to make
file requirements work but is a performance nightmare. To get around that
there is a different algorithm that can be used. Instead of verifying the
delta (resolve requires for added and provides for removed pkgs) one can
verify the whole transaction. This means resolve requirements of all
packages that stay installed and get installed. For normal requirements this
is much more expensive than the delta approach. But as there are comparably
few file requirements this is much faster than resolving every removed file.
So the idea is keeping the delta algorithm for normal requires and provides,
don't use files as provides and resolve file requirements globally.
There is one additional problem: As the resolver should keep unresolved
dependencies within the installed packages a list of all installed
unresolved file requirements must be calculated at the start and unresolved
file requirements must be check against it and be ignored if found.
Have fun
Florian Festi
More information about the Yum-devel
mailing list