This is the mail archive of the
mailing list for the Cygwin project.
RE: Performance of "ls -F"
- From: Bill Smith <bsmith at progress dot com>
- To: "William M. (Mike) Miller" <william dot m dot miller at gmail dot com>, "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Thu, 21 Jan 2016 19:52:21 +0000
- Subject: RE: Performance of "ls -F"
- Authentication-results: sourceware.org; auth=none
- References: <loom dot 20160121T163405-489 at post dot gmane dot org> <CAH5rLZVWiGz2n-3Ru-C0_5KU-Cc4NipJPn1NQVphN2UetUK4iA at mail dot gmail dot com>
In my particular case, we're seeing this behavior:
:$ //devnas04/largedisk/bsmith/netapp>time ls -ld struct5*
-rw-r--r-- 1 bsmith Domain Users 0 Nov 5 10:25 struct51.log
-rw-r--r-- 1 bsmith Domain Users 0 Nov 5 10:26 struct5z.prf
:$ //rdlserv/testdata/rdl117_nt/test>time ls -ld struct5*
-rwxrwx---+ 1 Unknown+User Unknown+Group 23047 Nov 4 21:47 struct51.log
-rwxr-x---+ 1 Unknown+User Unknown+Group 595 Oct 31 23:53 struct5z.prf
The difference is 1.3 seconds versus 1 minute 7 seconds. The directory is identical on the two NetApps and they both contain ~29K files. C-dot (Cluster Data On Tap) is the newest operating system for the NetApp. It also supports the newer SMB protocols.
I also tried the experiment with MKS Toolkit 8.6 and in both cases, it takes around .1 seconds.
> -----Original Message-----
> From: email@example.com [mailto:firstname.lastname@example.org] On
> Behalf Of William M. (Mike) Miller
> Sent: Thursday, January 21, 2016 10:53 AM
> To: email@example.com
> Subject: Re: Performance of "ls -F"
> On Thu, Jan 21, 2016 at 10:44 AM, Achim Gratz <Stromeko@nexgo.de>
> > I am finding a large performance gap between plain "ls" and "ls -F" in
> > a directory with many files on a network share (NetApp disguised as
> > NTFS if that matters). This has been there for quite a while, I've
> > just now realized what the reason was (I have "ls -F" as an alias for
> > "ls" in my interactive shells). In a directory with 1300 files, a
> > plain "ls" completes in 0.3s, while "ls -F" requires about 95s.
> > Determining the file class seems to require around 70...90ms per file,
> > which I can confirm also for directories with a lot less files.
> > What's involved in that determination that takes such a long time?
> The overhead appears to be in checking for executable files; using --file-type
> instead of -F, which just omits the '*' category, reduces the time for ls in one
> of my (local) large directories from over one second to 0.04 seconds.
> William M. (Mike) Miller | Edison Design Group firstname.lastname@example.org
> 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