-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider already selected packages during solve
We ran into a very very slow solve. I can't tell if it was actually slow or infinite, but it didn't seem to be convering very quickly. I realized that we essentially recurse the entire graph for every constraint, even for things we've already solved. This was surprising, because I thought we handled that already, but it seems like we didn't. I've added an example "abseil-regression.yaml" that took over a second to solve (as of this writing) before this change and takes about 1ms after this change. There's an open PR in wolfi that timed out because the abseil dep graph got even more gnarly and took several hours, so there was something (at least) quadratic going on here, oops. I've deleted a test that was exercising a scenario where packages were disallowed from providing themselves because there is no code path where that was actually possible (all invocations had "true" hard-coded). I also ran this against a several thousand image configs and they all produced the same results before and after this change, so I am fairly confident in it. Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
- Loading branch information
1 parent
cecb0d6
commit 58173e9
Showing
3 changed files
with
97 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This was very slow once. | ||
contents: | ||
keyring: | ||
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub | ||
repositories: | ||
- https://packages.wolfi.dev/os | ||
|
||
packages: | ||
- abseil-cpp-dev | ||
- pkgconf | ||
|
||
archs: | ||
- arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters