-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MyPy
and Pylint
partition inputs via CoarsenedTarget
#15141
Merged
stuhood
merged 3 commits into
pantsbuild:main
from
stuhood:stuhood/mypy-and-pylint-partition-via-ct
Apr 25, 2022
Merged
MyPy
and Pylint
partition inputs via CoarsenedTarget
#15141
stuhood
merged 3 commits into
pantsbuild:main
from
stuhood:stuhood/mypy-and-pylint-partition-via-ct
Apr 25, 2022
Conversation
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
CoarsenedTarget
MyPy
and Pylint
partition inputs via CoarsenedTarget
[ci skip-rust] [ci skip-build-wheels]
… targets. [ci skip-rust] [ci skip-build-wheels]
…tion to be shared. [ci skip-rust] [ci skip-build-wheels]
423d053
to
def8be0
Compare
This is ready for review. |
benjyw
approved these changes
Apr 25, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Another approach to mitigate the impact of this is #12652 - if only 1 constraint and 1 resolve is defined, then we can skip partitioning.
stuhood
added a commit
to stuhood/pants
that referenced
this pull request
Apr 25, 2022
…d#15141) `CoarsenedTarget`s are structure shared, and because they preserve their internal structure, they can service requests for transitive targets for different roots from the same datastructure. Concretely: Mypy and Pylint can consume `CoarsenedTargets` to execute a single `@rule`-level graph walk, and then compute per-root closures from the resulting `CoarsenedTarget` instances. This does not address pantsbuild#11270 in a general way (and it punts on pantsbuild#15241, which means that we still need per-root transitive walks), but it might provide a prototypical way to solve that problem on a case-by-case basis. Performance wise, this moves cold `check ::` for ~1k files from: * `main`: 32s total, and 26s spent in partitioning * `branch`: 19s total, and 13s spent in partitioning The rest of the time is wrapped up in pantsbuild#15241. # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
stuhood
added a commit
that referenced
this pull request
Apr 25, 2022
…ck of #15141) (#15244) `CoarsenedTarget`s are structure shared, and because they preserve their internal structure, they can service requests for transitive targets for different roots from the same datastructure. Concretely: Mypy and Pylint can consume `CoarsenedTargets` to execute a single `@rule`-level graph walk, and then compute per-root closures from the resulting `CoarsenedTarget` instances. This does not address #11270 in a general way (and it punts on #15241, which means that we still need per-root transitive walks), but it might provide a prototypical way to solve that problem on a case-by-case basis. Performance wise, this moves cold `check ::` for ~1k files from: * `main`: 32s total, and 26s spent in partitioning * `branch`: 19s total, and 13s spent in partitioning The rest of the time is wrapped up in #15241.
stuhood
added a commit
to stuhood/pants
that referenced
this pull request
Apr 29, 2022
…e in `check`. (pantsbuild#15277) pantsbuild#15141 gave `CoarsenedTarget` new usecases, which unfortunately exposed a case where `check` would re-run in exponential runtime due to not having implemented a TODO about `__eq__` using a memoized graph walk. [ci skip-rust] [ci skip-build-wheels]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CoarsenedTarget
s are structure shared, and because they preserve their internal structure, they can service requests for transitive targets for different roots from the same datastructure. Concretely: Mypy and Pylint can consumeCoarsenedTargets
to execute a single@rule
-level graph walk, and then compute per-root closures from the resultingCoarsenedTarget
instances.This does not address #11270 in a general way (and it punts on #15241, which means that we still need per-root transitive walks), but it might provide a prototypical way to solve that problem on a case-by-case basis.
Performance wise, this moves cold
check ::
for ~1k files from:main
: 32s total, and 26s spent in partitioningbranch
: 19s total, and 13s spent in partitioningThe rest of the time is wrapped up in #15241.