Lin patch: fast dependency resolution

Kok, Auke sofar at foo-projects.org
Sun Jul 22 08:14:45 CEST 2007


Ben Kelly wrote:
> Another patch for lin, this time one that speeds up dependency
> resolution dramatically. Currently, lin will resolve dependencies for a
> module multiple times (once for each package it's installing that
> depends on it), which is why some things (XOrg7 in particular) take so
> long to resolve. This patch changes it so that it will skip resolution
> of a module if it's already in the is_depends list, on the grounds that
> in that case we've already done dependencies for it and thus all its
> dependencies should also be in the list.
> 
> This one I'm actually not 100% sure of; it seems too simple. I've been
> using it on my own systems with no problems, but I'd appreciate it if
> someone who groks lin more thouroughly could take a look.

Well, it's indeed very simple as you put it:

if (check something); then
	do something that makes checking again not needed

since you bypass `add_depends` and `lin --deps $DEP` when `is_depends $DEP` is 
true, we're indeed in the situation that we can skip this code.

this only increases performance if we have a large tree with lots of new modules 
(like installing XOrg7 for the first time). However, it adds a slight overhead 
when traversing a tree that already was satisfied properly.

In any case it's OK - we don't skip anything we need, and traversing new trees 
is the biggest weakness right now.

I merged it into theedge... someone might want to try this on a virgin box 
without XOrg7 and see what the difference really is ;)

Auke


More information about the Lunar-dev mailing list