-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Improvement: #13420 - Update logic of nodes._check_initialpaths_for_relpath #13448
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
Improvement: #13420 - Update logic of nodes._check_initialpaths_for_relpath #13448
Conversation
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.
Clever
Let's associate the pr id and mention further improvement
update AUTHORS
for more information, see https://pre-commit.ci
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.
Nice catch! Thanks!
Changelog updated as requested.
Yes, you are welcome to. 👍 |
@nicoddemus thanks for editing the changelog entry! |
@nicoddemus @RonnyPfannschmidt |
Backport to 8.3.x: 💚 backport PR created✅ Backport PR branch: Backported as #13451 🤖 @patchback |
Use `Path` facilities to greatly improve performance of `nodes._check_initialpaths_for_relpath` (see #13448 for performance comparison). Related: #13420, #13413. --------- Co-authored-by: Bruno Oliveira <[email protected]> (cherry picked from commit bd6877e)
…13451) Use `Path` facilities to greatly improve performance of `nodes._check_initialpaths_for_relpath` (see #13448 for performance comparison). Related: #13420, #13413. --------- (cherry picked from commit bd6877e) Co-authored-by: Sashko <[email protected]> Co-authored-by: Bruno Oliveira <[email protected]>
Updates logic of
nodes._check_initialpaths_for_relpath
An even better fix for #13420 and this discussion - #13413
I still wasn't quite happy with the performance.
So after close examination of what
nodes._check_initialpaths_for_relpath
does, I came up with the PR changes.Previous logic:
initial_paths
.Instead, I propose the following:
initial_paths
.relative_to
will return"."
, and function should return""
initial_paths
. If it is, then return the relative path of the given path and that parent.Performance changes for collecting 1000 tests with stucture described in #13420 and #13413 (times are almost the same for main and 8.3.x branches):
Base
With improved logic
PS Couple of questions: