Don't always walk all World() packages

With this change the solver during install now considers only the part
of the tree which is required to calculate the solution, it doesn't
consider anymore World() as the search space.

The search space now is narrowed down to the packages that related to
the one which we are considering.

In this subset of changes we are also optimizing the Parallel solver
avoiding an useless loop.

This change boost overall performance on large datasets which don't
necessarly have relations touching the whole tree.
This commit is contained in:
Ettore Di Giacinto
2020-10-30 19:12:12 +01:00
parent 2fa58fc7db
commit f6a4b634c1
11 changed files with 355 additions and 123 deletions

View File

@@ -108,10 +108,10 @@ var _ = Describe("Solver", func() {
Expect(solution).To(ContainElement(PackageAssert{Package: A, Value: true}))
Expect(solution).To(ContainElement(PackageAssert{Package: C, Value: true}))
Expect(solution).To(ContainElement(PackageAssert{Package: E, Value: true}))
Expect(solution).To(ContainElement(PackageAssert{Package: B, Value: false}))
Expect(solution).To(ContainElement(PackageAssert{Package: D, Value: false}))
// Expect(solution).To(ContainElement(PackageAssert{Package: B, Value: false}))
//Expect(solution).To(ContainElement(PackageAssert{Package: D, Value: false}))
Expect(len(solution)).To(Equal(5))
Expect(len(solution)).To(Equal(3))
})
It("Solves correctly if the selected package to install has requirements", func() {