-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[performance] Avoid linear walk of graph children.
When calling Dune in scenarios where targets have a large number of deps, Dune will take a long time to start. A common case is when depending on `(package coq)`, which brings into the DAG a few thousand files. `perf` data show this is due to the linear walk in `Dag.is_child`; indeed, doing a naive replacement of the list for a more efficient access structure solves the problem: ``` with this PR: real 0m1,684s user 0m1,552s sys 0m0,128s with master: real 0m11,450s user 0m10,587s sys 0m0,264s ``` This PR is an attempt to fix this by using a more efficient representation of deps [that allows checking of deps in log n time, so the complexity of `is_child` goes from O(n²) to O(n log(n)). Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
- Loading branch information
Showing
6 changed files
with
31 additions
and
24 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