这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@otaithleigh
Copy link
Contributor

@otaithleigh otaithleigh commented Aug 25, 2023

Description

Closes #13033.

On WSL, the entire Windows PATH is inherited, and calling isfile (specifically, os.stat) across the filesystem boundary is extremely slow. Delaying the check until after pattern matching speeds things up considerably. (30s -> 1s on my machine.)

I've checked on the plain Windows side, and this appears to speed things up there as well (~900ms -> ~400ms).

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

On WSL, the entire Windows PATH is inherited, and calling `isfile`
(specifically, `os.stat`) across the filesystem boundary is
extremely slow. Delaying the check until after pattern matching
speeds things up considerably.
@otaithleigh otaithleigh requested a review from a team as a code owner August 25, 2023 20:43
@conda-bot
Copy link
Contributor

We require contributors to sign our Contributor License Agreement and we don't have one on file for @otaithleigh.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#814), and ping the bot to refresh the PR.

@travishathaway
Copy link
Contributor

@conda-bot check

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 26, 2023
jezdez
jezdez previously approved these changes Aug 26, 2023
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just needs a news file, good catch!

@otaithleigh
Copy link
Contributor Author

Added news entry! Wasn't sure if this fell under enhancements or bug fixes, went with bug fixes

@jezdez
Copy link
Member

jezdez commented Aug 28, 2023

@otaithleigh Totally a bugfix, thank you!

@kenodegard kenodegard merged commit ae409f8 into conda:main Aug 28, 2023
@dholth
Copy link
Contributor

dholth commented Sep 7, 2023

Would https://docs.python.org/3/library/os.html#os.scandir avoid the isfile() calls?

dholth pushed a commit that referenced this pull request Sep 11, 2023
On WSL, the entire Windows PATH is inherited, and calling `isfile`
(specifically, `os.stat`) across the filesystem boundary is
extremely slow. Delaying the check until after pattern matching
speeds things up considerably.
kenodegard added a commit that referenced this pull request Sep 11, 2023
* Speed up find_commands() on WSL (#13035)

On WSL, the entire Windows PATH is inherited, and calling `isfile`
(specifically, `os.stat`) across the filesystem boundary is
extremely slow. Delaying the check until after pattern matching
speeds things up considerably.

---------

Co-authored-by: P. Talley <otaithleigh@users.noreply.github.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
@jezdez jezdez mentioned this pull request Sep 26, 2023
92 tasks
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

conda info Performance regression in 23.7.3 on WSL (find_commands slowdown)

6 participants