Repository navigation
[PR #13448/bd6877e5 backport][8.3.x] Improvement: #13420 - Update logic of nodes._check_initialpaths_for_relpath - #13451
Merged
nicoddemus merged 1 commit intoMay 29, 2025
Conversation
nicoddemus
approved these changes
May 29, 2025
nicoddemus
enabled auto-merge (squash)
May 29, 2025 13:22
Member
|
The RTD failure is unrelated: |
Member
|
I will go ahead and merge it. 👍 |
nicoddemus
disabled auto-merge
May 29, 2025 13:48
nicoddemus
deleted the
patchback/backports/8.3.x/bd6877e5874b50ee57d0f63b342a67298ee9a1c3/pr-13448
branch
May 29, 2025 13:48
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.
This is a backport of PR #13448 as merged into main (bd6877e).
Updates logic of
nodes._check_initialpaths_for_relpathAn 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_relpathdoes, I came up with the PR changes.Previous logic:
initial_paths.Instead, I propose the following:
initial_paths.relative_towill 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
ncalls tottime percall cumtime percall filename:lineno(function) 5821 2.591 0.000 83.172 0.014 nodes.py:547(_check_initialpaths_for_relpath)With improved logic
ncalls tottime percall cumtime percall filename:lineno(function) 5821 0.020 0.000 0.337 0.000 nodes.py:547(_check_initialpaths_for_relpath)PS Couple of questions: