-
Notifications
You must be signed in to change notification settings - Fork 2k
Speed up find_commands() on WSL #13035
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
Speed up find_commands() on WSL #13035
Conversation
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.
|
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. |
|
@conda-bot check |
jezdez
left a comment
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.
This just needs a news file, good catch!
|
Added news entry! Wasn't sure if this fell under enhancements or bug fixes, went with bug fixes |
|
@otaithleigh Totally a bugfix, thank you! |
|
Would https://docs.python.org/3/library/os.html#os.scandir avoid the isfile() calls? |
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.
* 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>
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 ...
newsdirectory (using the template) for the next release's release notes?