-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign private scope closure check for performance
Redesigns the algorithm for checking the private scope closure property in the solver. The algorithm is described in detail in the comment of `findBadPrivClosures`. A key change is that we construct and propagate together with the `RevDepMap` a cache of the private scopes at every node, which allow us to efficiently look up the "root" packages from which we can easily validate the property holds. This change was prompted by stress testing private dependencies: The stress test uncovered that way too much time was being spent on validating the closure property, despite the property already being checked at every node. Specifically, the baseline for solving without the check was 11s, however, with the check in place, solving instead took over 50s when NO private dependencies were in the plan, and over 2 minutes when there were a lot of private scopes. After this change, the check of the private scope closure property is negligible on performance, being slightly faster (40ms) when there are a lot of private scopes (because the algorithm short circuits faster) and slightly slower (90ms) when there are no private scopes at all. This is more in line with the `findCycles` check takes some 110ms on my machine. This commit also adds the stress test which uncovered the problem, however, this stress test is disabled by default and should only be run manually since testing time-based performance in CI can be problematic.
- Loading branch information
Showing
27 changed files
with
430 additions
and
221 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
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
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
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
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
Oops, something went wrong.