From 71c9e95b223517b5f51c4627f6ad4cce8af0d901 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 16:28:21 +0200 Subject: split-up Dependency struct Having dependency data separated from the link between version/package and the dependency allows use to work on sharing the depdency data a bit as it turns out that many dependencies are in fact duplicates. How many are duplicates various heavily with the sources configured, but for a single Debian release the ballpark is 2 duplicates for each dependency already (e.g. libc6 counts 18410 dependencies, but only 45 unique). Add more releases and the duplicates count only rises to get ~6 for 3 releases. For each architecture a user has configured which given the shear number of dependencies amounts to MBs of duplication. We can cut down on this number, but pay a heavy price for it: In my many releases(3) + architectures(3) test we have a 10% (~ 0.5 sec) increase in cache creationtime, but also 10% less cachesize (~ 10 MB). Further work is needed to rip the whole benefits from this through, so this is just the start. Git-Dch: Ignore --- apt-pkg/depcache.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apt-pkg/depcache.cc') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 6271a024a..7b1448c73 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -348,22 +348,21 @@ bool pkgDepCache::CheckDep(DepIterator const &Dep,int const Type,PkgIterator &Re bug. Conflicts may never self match */ if (Dep.IsIgnorable(Res) == false) { - PkgIterator Pkg = Dep.TargetPkg(); // Check the base package if (Type == NowVersion) { - if (Pkg->CurrentVer != 0 && Dep.IsSatisfied(Pkg.CurrentVer()) == true) + if (Res->CurrentVer != 0 && Dep.IsSatisfied(Res.CurrentVer()) == true) return true; } else if (Type == InstallVersion) { - if (PkgState[Pkg->ID].InstallVer != 0 && - Dep.IsSatisfied(PkgState[Pkg->ID].InstVerIter(*this)) == true) + if (PkgState[Res->ID].InstallVer != 0 && + Dep.IsSatisfied(PkgState[Res->ID].InstVerIter(*this)) == true) return true; } else if (Type == CandidateVersion) - if (PkgState[Pkg->ID].CandidateVer != 0 && - Dep.IsSatisfied(PkgState[Pkg->ID].CandidateVerIter(*this)) == true) + if (PkgState[Res->ID].CandidateVer != 0 && + Dep.IsSatisfied(PkgState[Res->ID].CandidateVerIter(*this)) == true) return true; } -- cgit v1.2.3