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

Performance problems on Windows 10's Windows Subsystem for Linux #63

Open
ethanherbertson opened this issue Jul 10, 2018 · 6 comments
Open

Comments

@ethanherbertson
Copy link

I suspect this is not something that can feasibly be fixed, however I figured I'd better report it anyway.

After installing smartcd in my Windows Subsystem for Linux (the Ubuntu 16.04 LTS flavor), changing directories—even ones without "enter" scripts—began taking multiple seconds to complete. Before installing smartcd, and after uninstalling smartcd, changing directories takes somewhere between a tenth of a second and half a second.

I believe it is a known shortcoming with WSL that filesystem actions can take significantly longer than what you'd expect, if for no other reason than NTFS is frequently not optimized for the same kinds of activities that Linux filesystems are. However, I suspect in this case the problem is more due to inefficiencies in WSL's bash—possibly in the implementation of functions?—than any filesystem/hardware shenanigans.

For now I've uninstalled the tool rather than look into it further. If you want me to help debug I'm willing, but if you're inclined to "will not fix" this I'd understand that as well.

@jcrben
Copy link

jcrben commented Dec 14, 2018

Performance could use some work on my macbook too.

I profiled it using the instructions at https://stackoverflow.com/questions/5014823/how-to-profile-a-bash-shell-script-slow-startup by dropping the first part at the top of function_smartcd

# Don't run this twice consecutively from being sourced. If the user double-sources
and the last at the end.

Then tail -f /tmp/<file> and you can see there's a lot of commands - none of them in particular seemed slow, but it adds up... gonna look at switching over to direnv

@mortelle1806
Copy link

Same problem here with WSL (same version as @ethanherbertson), to the point I have to consider other solutions (as much as I love smartcd's feature set). I've noticed that ondir does not exhibit this issue (no delay when switching with the non builtin cd). Since ondir is implemented in C, this could indeed point to bash running on WSL being inefficient.

@ethanherbertson
Copy link
Author

Update: With the October 2018 Windows build, and with Ubuntu 18 LTS, this issue seems to be much less serious. Changing directories with smartcd installed now seems to take between half a second and a second.

@cxreg
Copy link
Owner

cxreg commented Mar 13, 2019

I've been trying to find some time to rework some of the internals to use less expensive operations which may further reduce the impact of this. Thanks for your patience on this

@mortelle1806
Copy link

Update: With the October 2018 Windows build, and with Ubuntu 18 LTS, this issue seems to be much less serious. Changing directories with smartcd installed now seems to take between half a second and a second.

Sorry to pollute this thread with my question, but @ethanherbertson can you please tell me if switching your Windows build from the old to the new one (version 1809?) preserved your whole WSL setup? I would be interested to give it a try if it's harmless. Thanks.

@ethanherbertson
Copy link
Author

ethanherbertson commented Mar 19, 2019 via email

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

4 participants