Improve performance of algorithm to determine project deps #518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces smarter tracking of deps as they are loaded. These changes help to avoid traversing the same dep sub-trees multiple times. For larger projects, including umbrella projects, the same dep can be traversed millions of times.
One of our larger projects is an umbrella project with 20 umbrella apps and a little over 200 deps in our mix.lock file. With Elixir 1.15, the time it takes for dialyzer to complete increased 3x due to this issue, from 15 minutes in our CI to over 45 minutes. In order to get dialyxir working on Elixir 1.15, I also had to follow the advice in #508 to add the dialyzer dep to each app in the umbrella. I'm not sure if that caused the increase in deps being returned, or if it's due to the new logic around optional apps.
The following table represents the time it takes to run the
Dialyxir.Project.include_deps/0
function against that project on my local (faster than CI machine), and how many apps the function returns: