This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ls.exe slow down in cygwin 1.3.13 (a followup from the "ls problem" thread last november 2002)

Good Day Cygwineers (cygwin engineers),

Last November 2002, I've upgraded cygwin and encountered a variation in the behaviour of ls.  ls, when invoked as "ls -l" takes a
bit longer to execute than the previous cygwin version.  (I've attached the output of cygehck.)  I haven't upgraded cygwin since
November 2002 last year since I'm content with my installation now.  The current variation in the behaviour of ls is not really a
problem but I'd be glad if I could let it behave as it used to.

I've posted the this observation last year in the list (under the thread "ls -problem" and I thank everyone for their replies.     Sorry if I just did a follow-up now
(after 6 months) since I didn't have time to worry about my cygwin setup several days after I posted my observation.   After some
days of doing some research on what could be the solution to make ls behave as it used to, I finally said I'd just be content with
the way it is.  But now that I've got time to answer all the replies, I hope we could find a solution to the issue.

I don't plan to upgrade my cygwin installation since it behaves very well and my current needs do not demand that I upgrade cygwin

Here's the gist of the problem:

Whenever ls is invoked as "ls -l", the output takes somewhat longer.  I tried timing the output and here are the results:

I'm working on my ~/foo directory.  The directory contains 2 items: bar and strace.txt.  bar is an empty directory and strace.txt is
a regular text file.

case 1) ls invoked plainly

fcarlo@THORIN ~/foo
$ time ls
bar  strace.txt

real    0m0.028s
user    0m0.030s
sys     0m0.015s

case 2) ls is invoked as "ls -l"

fcarlo@THORIN ~/foo
$ time ls -l
total 49
drwxr-xr-x    2 fcarlo   None            0 Jun 30 11:20 bar
-rw-r--r--    1 fcarlo   None        49394 Jun 30 11:08 strace.txt

real    0m1.924s
user    0m0.030s
sys     0m0.046s

I've tried repeating the invocation of "ls -l" in the hope that the list would be cached.  After invoking it several times, there is
no significant change in the time it takes to execute.

I've tried stracing the output of "ls -l" and I've attached the output of strace too.
An observation on the output of strace is that the delay starts when line 442 is printed.

Line 442 of the strace output is:

104 1970355 [main] ls 2012 _open: -1 = open (/usr/local/etc/zoneinfo/posixrules, 0x10000)

I'm wondering what this zoneinfo/posixrules is.  The file does not exist in my installation.

Here are my responses to the replies by the gurus:

Reply to Igor:

>It would have been more helpful if you had provided your cygwin version, but even without it I could venture a guess...  The latest
versions of cygwin have ntsec on by default, and doing 'ls -l' will result in the user
lookup in the /etc/passwd (and /etc/group) file.  An easy way to test that
is to time 'ls -ln' and see if it's faster.  Another test would be to
*temporarily* turn off ntsec (by adding "nontsec" to your CYGWIN
environment variable and reloading cygwin1.dll by exiting all running
cygwin processes).  I say temporarily because ntsec is actually a very
useful feature to have on, and this is suggested only as a means to find
out whether it's the culprit.  You can restore the state by either
changing "nontsec" to "ntsec", or leaving it off altogether, as it's the
default now, and reloading cygwin1.dll again.

Carlo Florendo
Astra Philippines, Inc.

Attachment: strace.txt
Description: Text document

Attachment: cygcheck.txt
Description: Text document

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]