public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Performance of "ls -F"
Date: Mon, 25 Jan 2016 21:03:00 -0000	[thread overview]
Message-ID: <20160125200841.GB26077@calimero.vinschen.de> (raw)
In-Reply-To: <loom.20160125T111636-839@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2758 bytes --]

On Jan 25 11:02, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > 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).
> 
> acl > time ls --file-type > /dev/null
> 0.015u 0.015s 0:00.42 4.7%      0+0k 0+0io 2473pf+0w
> acl > time ls -F > /dev/null
> 0.078u 0.858s 1:10.69 1.3%      0+0k 0+0io 5243pf+0w
> 
> noacl > time ls --file-type > /dev/null
> 0.015u 0.015s 0:00.37 5.4%      0+0k 0+0io 2391pf+0w
> noacl > time ls -F > /dev/null
> 0.093u 1.327s 1:38.90 1.4%      0+0k 0+0io 6309pf+0w
> 
> >  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?
> 
> acl,notexec > time ls --file-type > /dev/null
> 0.015u 0.030s 0:00.41 9.7%      0+0k 0+0io 2471pf+0w
> acl,noexec > time ls -F > /dev/null
> 0.062u 0.811s 1:10.31 1.2%      0+0k 0+0io 5240pf+0w
> 
> noacl,notexec > time ls --file-type > /dev/null
> 0.031u 0.030s 0:00.41 14.6%     0+0k 0+0io 2389pf+0w
> noacl,notexec > time ls -F > /dev/null
> 0.046u 0.718s 0:56.23 1.3%      0+0k 0+0io 4994pf+0w
> 
> > 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...
> 
> Looks like that's not the main reason for the extra time spent.

Off the top of my head, the common denominator seems to be that on
directories returning d_type information, --file-type doesn't have to
call stat().  That makes it very fast since only a directory enumeration
is done.  Calling stat on the other hand is time consuming since on
Windows it requires to open the file and read meta information (including
the ACL) or data (noacl exe recognition) from it.

> Here's another NetApp share, but this time there are about half as many
> files with only two of them in each sub-directory.
> 
> (1046)/mnt/upload/install > time ls --file-type x86*/patches/*/* > /dev/null
> 0.155u 1.358s 0:09.42 15.9%     0+0k 0+0io 10555pf+0w
> (1047)/mnt/upload/install > time ls -F x86*/patches/*/* > /dev/null
> 0.109u 1.046s 0:08.20 13.9%     0+0k 0+0io 9817pf+0w
> 
> Somehow that takes a lot less time and there's no difference between the two
> invocations (or actually a bit less time for -F).  The getVolInfo helper
> sees these two shares with the same settings.  Not sure what to make of that...

Hmm, no, sorry, I have no idea.  Somebody will have to debug this.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-01-25 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 18:10 Achim Gratz
2016-01-21 18:34 ` William M. (Mike) Miller
2016-01-21 19:09   ` Achim Gratz
2016-01-21 19:56   ` Bill Smith
2016-01-22 15:09     ` Achim Gratz
2016-01-22 22:19       ` Corinna Vinschen
2016-01-22 23:21         ` Achim Gratz
2016-01-23 19:55           ` Corinna Vinschen
2016-01-25 20:54             ` Achim Gratz
2016-01-25 21:03               ` Corinna Vinschen [this message]
2016-01-21 19:54 ` Bill Smith
2016-01-21 21:40   ` Achim Gratz
2016-01-25 20:08 Lemke, Michael  ST/HZA-ZIC2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125200841.GB26077@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).