MC is very slow when starting and changing directories on Windows 10 #3662
Labels
area: core
Issues not related to a specific subsystem
prio: medium
Has the potential to affect progress
res: invalid
The ticket is not a bug, or is a support request
Important
This issue was migrated from Trac:
chanibal
(mc@….pl)cygwin
,slow
I'm using midnight commander with Cygwin 64 bit on Windows 10 64 bit.
After moving to a new machine and a clean reinstall of windows and Cygwin, my Midnight Commander started to get very laggy - starting mc, any change of directory or exiting from finding files (to refresh list of files in the two panes) takes long seconds. Restarting doesn't help.
I have no idea what could be the reason for these hiccups. MC normally works fine: arrow presses work well, viewing and editing is instant, I can autocomplete paths on the command line with no lag.
But this one thing takes up to 10 seconds - changing directories. Searching in files has a similar lag, but only once (ie not in every chdir it could have done). In non-mc Cygwin usage this issue doesn't happen.
The task manager doesn't show any abnormally high CPU or memory usage on any process. I have cygserver running, using bash as my shell and have no fancy PS1 settings, my $CYGWIN is only winsymlinks:native.
I'm dealing with this issue for some time now and it really impedes my work. If you need me to run some other tests or need any more info from me, please ask and I'll do what I can. This question has already been asked on SuperUser (http://superuser.com/questions/1097601/midnight-commander-sometimes-very-slow) and Cygwin mailing list.
My environment
strace log
Here is a strace log, maybe someone has an idea what did go wrong?
http://pastebin.pl/view/9b839815
(recorded with LOCALE=C strace -q -o /tmp/mc-log mc /tmp)
In the recorded session I have:
You can see that normalize_posix_path takes a lot of time, but trying
to force the same call with cygpath fails to take so long (more
later).
Additional timing information
TL;DR: probably not Cygwin's fault.
A find of all directories in my $HOME takes 4.6 seconds:
A ls -al on all of these 19919 directories took a lot of time, but
the average was fairly low:
The average time to do an ls -al is 0.020s, min is 0.017, max is 0.154:
/cygdrive/c/Users/chanibal/AppData/Local/Android/sdk/platforms/android-23/data/res/drawable-hdpi
With the overhead of measuring time it averages 16m34s/19919 = 0.499s
per call to ls -al, two awks and a iteration of find. Not very
good, but not four seconds.
Normalizing with cygpath doesn't take long:
normalize_posix_path
/tmp/NVIDIA Corporation/
/tmp/NVIDIA Corporation/ = normalize_posix_path (/tmp/NVIDIA
Corporation/)
Other Midnight Commander builds
I have also tried the unofficial mc build for windows that does not use cygwin and build my own mc from current master at github. This issue persisted.
The text was updated successfully, but these errors were encountered: