Performance of "ls -F"

Corinna Vinschen corinna-cygwin@cygwin.com
Sat Jan 23 19:55:00 GMT 2016


On Jan 22 22:04, Achim Gratz wrote:
> Corinna Vinschen writes:
> > Just a hint:  ls -F requires to stat every single file.  stat in turn
> > requires to load not only the usual metadata but also to fetch the ACL
> > and convert it to POSIX permissions.
> 
> The timings are from shares mounted with the noacl option, so that bit
> of code shouldn't be involved.  I will try the same operations on an ACL
> enabled mount of the same share later and I also need to find a share
> that is exported from a true NTFS server for comparison.
> 
> > Assuming this slow access only occurs under 2.4.0,
> 
> No, the behaviour is quite a bit older, although I didn't time it since
> I didn't recognize the connection to the aliased ls.  In any case, it
> really is just the determination of whether or not the file is
> executable that takes up all that time.

In the noacl case, Cygwin tries to find out if files are scripts.  It
opens the file and checks the first two bytes in the file for a shebang
(and other stuff).  This may take a lot of time, more so on network
drives.  Can you try adding the "notexec" mount option to the "noacl"
share and see if that helps?

This test is done for a looong time to accommodate FAT filesystems in
the first place.  It might be prudent to disable it by default these
days...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160123/110dcd7e/attachment.sig>


More information about the Cygwin mailing list