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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Date: Fri, 8 Jul 2016 16:13:53 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Midnight Commander is very slow when starting and changing directories To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 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 }'