delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/02/14:27:16

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
From: "David Tazartes" <davidt81 AT earthlink DOT net>
To: <cygwin AT cygwin DOT com>
In-Reply-To: <E1Miu9g-00033d-0h@elasmtp-kukur.atl.sa.earthlink.net>
Subject: RE: Simple bash script is slow to execute - appears to be time spent starting commands like ls
Date: Wed, 2 Sep 2009 14:26:51 -0400
MIME-Version: 1.0
Message-ID: <E1MiuXo-0005Jo-GH@elasmtp-masked.atl.sa.earthlink.net>
X-ELNK-Trace: 5bf265d7c89f1e8e1aa676d7e74259b7b3291a7d08dfec798414071d86ae715fc3a54f0d83e0c188350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

I wrote:

Let's say we focus on the echo | cut slowness I mentioned earlier. This is
independent of the CWD and doesn't cause the explorer.exe spike but is still
200 times slower on my Vista laptop than on a low-powered Linux server. If
we correct this problem, I'm pretty confident the time per loop will go way
down.

I've also confirmed these results on my work PC. It's much faster than my
laptop (120 ms vs 800 ms) but it's still much slower than the 2-6 ms I get
on the server.

-----

For this test, rather than using cut I decided to use wc -l, it's a little
simpler. When I run:

echo hi | strace wc -l

I get this trace, with one line in particular that seems to have taken a
very long time, near the bottom.

   12      12 [main] wc 2332 open_shared: name shared.5, n 5, shared
0x60FC0000 (wanted 0x60FC0000), h 0xC4
  156     168 [main] wc 2332 heap_init: heap base 0xDA0000, heap top
0xDA0000
   91     259 [main] wc 2332 open_shared: name
S-1-5-21-1723455903-1123245079-927917492-1000.1, n 1, shared 0x60FD0000
(wanted 0x60FD0000), h 0xCC
   43     302 [main] wc 2332 user_shared_create: opening user shared for
'S-1-5-21-1723455903-1123245079-927917492-1000' at 0x60FD0000
   40     342 [main] wc 2332 user_shared_create: user shared version
2E710001
   57     399 [main] wc 2332 events_init: windows_system_directory
'C:\Windows\system32\', windows_system_directory_length 20
  107     506 [main] wc 2332 dll_crt0_0: finished dll_crt0_0 initialization
  128     634 [main] wc 2332 _cygtls::remove: wait 0xFFFFFFFF
   56     690 [main] wc 2332 _cygtls::remove: removed 0x22CE64 element 0
   77     767 [main] wc 2332 _cygtls::remove: wait 0xFFFFFFFF
   34     801 [main] wc 2332 _cygtls::remove: removed 0x22CE64 element 0
164431  165232 [sig] wc 2332 wait_sig: entering ReadFile loop, my_readsig
0x2B0, my_sendsig 0x2B4
 2729  167961 [main] wc 2332 _cygwin_istext_for_stdio: fd 0: not open
   75  168036 [main] wc 2332 _cygwin_istext_for_stdio: fd 1: not open
   35  168071 [main] wc 2332 _cygwin_istext_for_stdio: fd 2: not open
... rest omitted ...





--
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