Merged
Conversation
See python#17948 Haven't run the benchmark yet, but profile indicates that this could save 0.5s on both incremental and non-incremental builds in environments with long search path
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This reverts commit a9602be.
This comment has been minimized.
This comment has been minimized.
JukkaL
reviewed
Oct 16, 2024
| """Given two paths, return if path is a sub-path of dir.""" | ||
| if not dir.endswith(os.sep): | ||
| dir += os.sep | ||
| return path.startswith(dir) |
Collaborator
There was a problem hiding this comment.
Does this will work reliably on Windows, where path separators can be / or \, and these are largely equivalent? Should we normalize separators on Windows, or can we assume everything is normalized here? I noticed that you added a call to os.path.normcase, so maybe this is already ok.
Maybe update docstring to mention Windows-specific issues, and case insensitivity issues?
Collaborator
Author
There was a problem hiding this comment.
Documented the shortcomings of the faster function + invariants we require in modulefinder. Also renamed the function so it sounds a little scarier
Contributor
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
hauntsaninja
added a commit
that referenced
this pull request
Oct 20, 2024
See #17948 - 1.01x faster on clean - 1.06x faster on long - 1.04x faster on openai - 1.26x faster on openai incremental
This file contains hidden or 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
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.
See #17948