after a lot of profiling, it should be much faster.
At some point, I broke something. If you're running current,
make sure Dependencies.pm is very recent.
In particular, around line 561, solve_depends should have:
delete $self->{installed};
and NOT:
$self->{installed} = [];
(the latter means pkg_add will not consider installed packages for dependencies,
at least not directly. It worked in my tests because I'm using fully populated
repositories, so I always got hits in the repository, which were then converted
to silent "no need to install since it's already there" and recached
properly in a very round-about way)