-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Skip repeated directories in PATH
when searching for Python interpreters
#12367
Conversation
which::which_in_global("python.bat", Some(&dir_clone)) | ||
// If we cannot determine if the directory is unique, we'll assume it is | ||
.unwrap_or(true) | ||
.then(|| { |
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.
Indented, best viewed with https://github.com/astral-sh/uv/pull/12367/files?diff=unified&w=1
Should this be implemented by de-duping the interpreters rather than the parent directories? I assume not, but it'd be good to note why. |
We probably could but I'm not sure what it gets us. We'd spend more time collecting interpreters we've already seen. We could dedupe interpreter paths instead of parent directories but that also just adds redundant directory item enumeration. |
I think that cost of that will be really low compared to the cost of querying the interpreters. But is it even better? Do we want to show symlinks of adjacent Python interpreters (like |
I agree. I don't see why it'd be preferable though.
Yes, I think it's important we can represent this. There are a couple reasons off the top of my head...
We could deduplicate those later, e.g., during the |
CodSpeed Performance ReportMerging #12367 will degrade performances by 10.19%Comparing Summary
Benchmarks breakdown
|
Closes #12302
The change is visible in this commit.