Skip to content
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

Completion takes 10-15 seconds to show on on wsl archlinux #1765

Open
Ultra-Code opened this issue Feb 8, 2024 · 10 comments
Open

Completion takes 10-15 seconds to show on on wsl archlinux #1765

Ultra-Code opened this issue Feb 8, 2024 · 10 comments

Comments

@Ultra-Code
Copy link

sample completion on asciinema.

To reproduce, on wsl archlinux

  • install elvish.
  • type a command and tab to get completion.
  • It take 10 ~ 20 sec sometimes to get the completion showing.

Screenshot 2024-01-30 161516

@xiaq
Copy link
Member

xiaq commented Feb 8, 2024 via email

@xiaq
Copy link
Member

xiaq commented Feb 8, 2024 via email

@Ultra-Code
Copy link
Author

This is the current list

image

Manually setting the paths to a small list gives me the expected responsiveness

image

@Ultra-Code
Copy link
Author

Is redefining paths, the only solution?

@xiaq
Copy link
Member

xiaq commented Feb 8, 2024 via email

@Ultra-Code
Copy link
Author

Okay, where can I add a note for WSL users, until the caching mechanism is implemented? Because I thought it was a bug in Elvish. Other WSL users might face a similar issue and think it's a problem with Elvish. I think documenting this temporary workaround would be a good idea, what do you think?

@xiaq
Copy link
Member

xiaq commented Feb 8, 2024

I guess having this issue in the issue tracker is good enough for now.

@Ultra-Code
Copy link
Author

Then I will leave this issue open, Thanks for helping out.

@krader1961
Copy link
Contributor

Manually setting the paths to a small list gives me the expected responsiveness

That is because you have removed paths that require WSL to map Unix filesystem operations to Windows filesystem operations. This is fundamentally not an Elvish problem. You should see this slowdown in any command run in a WSL environment (e.g., the find command) that performs filesystem operations on paths to the Windows environment. I can't see any practical way for Elvish to "cache" the results. If Elvish performs a command lookup that results in a "not found" error and caches that result how will it know that the cached result is stale after the command is added to a PATH directory regardless of whether it exists on the Windows or Linux environment? The only way such caching can work reliably is if there is a file system monitoring capability to asynchronously be notified if a directory in $PATH has been modified. And that is unlikely to exist now or in the immediate future.

@xiaq
Copy link
Member

xiaq commented Mar 5, 2024

Manually setting the paths to a small list gives me the expected responsiveness

That is because you have removed paths that require WSL to map Unix filesystem operations to Windows filesystem operations. This is fundamentally not an Elvish problem. You should see this slowdown in any command run in a WSL environment (e.g., the find command) that performs filesystem operations on paths to the Windows environment. I can't see any practical way for Elvish to "cache" the results. If Elvish performs a command lookup that results in a "not found" error and caches that result how will it know that the cached result is stale after the command is added to a PATH directory regardless of whether it exists on the Windows or Linux environment? The only way such caching can work reliably is if there is a file system monitoring capability to asynchronously be notified if a directory in $PATH has been modified. And that is unlikely to exist now or in the immediate future.

It is still on Elvish to make the default experience better. Right now the UI would entirely freeze while waiting for the completion results.

Also, I think you're supposed to respond to my comment regarding caching instead of @Ultra-Code, who was just reporting that their experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants