-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Improve performance of dependency inference #11094
Improve performance of dependency inference #11094
Conversation
[ci skip-rust] [ci skip-build-wheels]
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.
Awesome!
performance of dependency inference by not digesting files
Note that this also improves performance because editing the content of a file should no longer invalidate the _StrippedFileNames
value: PathGlob
expansion does not depend on file content. So rebuilds should be faster!
src/python/pants/backend/python/dependency_inference/module_mapper.py
Outdated
Show resolved
Hide resolved
# NB: We use a custom implementation to resolve the stripped source paths, rather than | ||
# `StrippedSourceFiles`, so that we can use `Get(Paths, PathGlobs)` instead of | ||
# `Get(Snapshot, PathGlobs)`, which is much faster. | ||
# | ||
# This implementation is kept private because it's not fully comprehensive, such as not looking | ||
# at codegen. That's fine for dep inference, but not in other contexts. |
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.
It's maybe worth referencing this implementation next to the other one, in case we recognize an opportunity to unify them?
[ci skip-rust] [ci skip-build-wheels]
7831724
to
140256a
Compare
…` now that graph cycle is fixed (#11188) Closes #10917. This cycle made sense. We were trying to use `HydratedSources` in a dep inference rule when `HydratedSources` already uses dependencies. This is why with the rule for `-> Subtargets`, we were avoiding `HydratedSources` in the first place. #11094 ended up fixing this without us realizing. This PR also factors up `SourcesPaths` and `StrippedSourceFileNames`, which are the reason we were able to fix this cycle. We'll want to use these types in other places, such as #11184. [ci skip-rust] [ci skip-build-wheels]
Before, 50 times:
After, 50 times:
[ci skip-rust]
[ci skip-build-wheels]