delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/07/08/10:14:50

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=GWVf3xcB65e913g4gw2ccoG/Z4s8n
8LM60E+8LJqCB/hRYghfXD5oOW+cBlTzERi1CqiKe1Mek1xyFlwBaB8kn/3UDlrf
7lz/b72QrsYdDNO2LFNoRofVzl04gpgCfFb9jxVrrOhydZW58H5U/IddvGJBPa9w
ZeomYh10pmB59s=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; s=default; bh=GD9mO8D+Xz0Ju8T3G6N6OINEIw0=; b=SQ3
eCeOEAQMfKPCqfHWVP7dnP+LffwpMeBfiQhTomttf9lj2JeHnY8ou4MXE4XeiMQL
MKUXbJv4IlK9goPkwz4sVa9H/ajyzcdP+fBKKn+26Q/JptI8izwzd8Kf20+AsX9C
inHQoQX9wCMuZgc9NUtACym9J97/oYvQNj3iI8vo=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=instant, anti, ssd, SSD
X-HELO: homiemail-a28.g.dreamhost.com
X-Gm-Message-State: ALyK8tKblnfyLPtLiL87scHhagK62Wxr0R/AjE72yoi5vwN+OctZWlE6VM4M2yPI4OO6v7iNoAzOI23NscFPVQ==
X-Received: by 10.55.102.202 with SMTP id a193mr7680380qkc.69.1467987253219; Fri, 08 Jul 2016 07:14:13 -0700 (PDT)
MIME-Version: 1.0
From: Krzysztof Bociurko <chanibal AT chanibal DOT pl>
Date: Fri, 8 Jul 2016 16:13:53 +0200
X-Gmail-Original-Message-ID: <CAB+S=LhrvgQLw4L1ik=2Hs=A0+7D-0JswNuUKKE5UxfWnZw_TA AT mail DOT gmail DOT com>
Message-ID: <CAB+S=LhrvgQLw4L1ik=2Hs=A0+7D-0JswNuUKKE5UxfWnZw_TA@mail.gmail.com>
Subject: Midnight Commander is very slow when starting and changing directories
To: cygwin AT cygwin DOT com

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,
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`.

My environment:
* Windows 10 pro 64 bit, up to date
* Not connected to a domain, no network drives
* No anti virus software apart from the one built in Windows
* Two hard drives (system on SSD (C:), D: is a SSHD), quite a few
directory junctions from C: to C:, no loops
* I'm usually using fatty as the terminal, but mintty has the same issues
* GNU Midnight Commander 4.8.17
* cygserver is installed



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:

* started mc in `/tmp` directory
* entered `/tmp/NVIDIA Corporation` directory
* went back up (`..`)
* entered `/tmp/mc-chanibal` directory
* went back up (`..`)
* exited with F10

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:

A find of all directories in my `$HOME` takes 4.6 seconds:

    $ time find ~ -type d | wc -l
    (snipped two directories without permissions)
    19919

    real    0m4.626s
    user    0m0.796s
    sys     0m3.765s

A `ls -al` on all of these 19919 directories took a lot of time, but
the average was fairly low:

    time (find ~ -type d | while read f; do { time ls -al $f; } \
       |& awk '$1 == "real" { printf $2 }'                      \
       | awk -Fm '{printf( "%2.4f", $1 * 60 + $2 )}';           \
       echo -e "\t$f"; done                                     \
    ) >/tmp/ls-time-log ;
    (snipped two dirs without permissions)

    real    12m21.870s
    user    7m4.576s
    sys     16m34.446s

The average time to do an `ls -al` is 0.020s, min is 0.017, max is 0.154:

    $ awk 'BEGIN { sum=0; min=9999; max=0;  minf=""; maxf=""; }     \
          $1 { sum += $1;                                           \
               if(min > $1) { min = $1; minf = $2; };               \
               if(max < $1) { max = $1; maxf = $2; } }              \
          END { print "avg: " sum/NR; print "min: " min " "         \
              minf; print "max: " max " " maxf }' </tmp/ls-time-log
    avg: 0.0204292
    min: 0.0170 /cygdrive/c/Users/chanibal/AppData/Roaming/OculusClient/Local
    max: 0.1540
/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 `awk`s and a iteration of `find`. Not very
good, but not four seconds.



Normalizing with `cygpath` doesn't take long:

    $ time strace cygpath -aw /tmp/NVIDIA\ Corporation/ | grep
normalize_posix_path
      116   11175 [main] cygpath 3524 normalize_posix_path: src
/tmp/NVIDIA Corporation/
       20   11195 [main] cygpath 3524 normalize_posix_path:
/tmp/NVIDIA Corporation/ = normalize_posix_path (/tmp/NVIDIA
Corporation/)

    real    0m0.034s
    user    0m0.015s
    sys     0m0.000s



I have also posted this issue to Super User, but after some discussion
with user Matzeri, he suggested for me to go on this list with this
problem. SU link:
http://superuser.com/questions/1097601/midnight-commander-sometimes-very-slow


-- KB

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019