Optimization and optional parallelization of typing minimization #2059
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.
I have implemented the optimization outlined in this post #1053 (comment) that reduces the minimization time by 50%.
Unfortunately, as the algorithm itself still has the complexity O(n2) certain large methods still can block method body generation for a long time.
A second implemented improvement allows to parallelize minimization. As multi-core system are common nowadays this can reduce the time necessary to perform typing minimization. Parallelization is in this PR enabled if there are more than 1000 Typing available.
In the end this is not a real solution but it can increase the number apps that can be analyzed within a certain time (e.g. 24 hours).
Unit tests has been adapted to cover both sequential and parallel implementation.