public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Roland Mainz <roland.mainz@nrubsig.org>
To: cygwin@cygwin.com
Subject: Re: rfe: CYGWIN fslinktypes option? Re: Catastrophic Cygwin find . -ls, grep performance on samba share compared to WSL&Linux
Date: Sun, 24 Dec 2023 01:47:09 +0100	[thread overview]
Message-ID: <CAKAoaQnQ2eL9JJfn=CeJ06WujqgLdLVeXS7ojf7GvvmkB-KYoA@mail.gmail.com> (raw)
In-Reply-To: <4723aab7e2b331cb81946eff0fb4e862@kylheku.com>

On Thu, Dec 21, 2023 at 9:32 PM Kaz Kylheku via Cygwin
<cygwin@cygwin.com> wrote:
> On 2023-12-21 04:16, Martin Wege via Cygwin wrote:
> > On Wed, Dec 20, 2023 at 6:21 PM Kaz Kylheku via Cygwin
> > <cygwin@cygwin.com> wrote:
[snip]
> > The root cause is IMO the extra Win32 syscalls (>= 3 per file lookup,
> > compared to 1 on Linux) to lookup the *.lnk and *.exe.lnk files on
> > filesystems which have native link support (NTFS, ReFS, SMBFS, NFS).
> > On SMBFS and NFS it hurts the most, because access latency is the
> > highest for networked filesystems.
>
> Could some intelligent caching be added there? (Discussion of
> associated invalidation problem in 3... 2.... 1... )

See below, basically a short-lived cache which is only valid for the
lifetime of the one POSIX function call would be OK...

> Can you discuss more details, so people don't have to dive into code
> to understand it? If we are accessing some file "foo", the application
> or user may actually be referring to a "foo.lnk" link. But in the
> happy case that "foo" exists, why would we bother looking for "foo.lnk"?
>
> If "foo" does not exist, but "foo.lnk" does, that could probably be
> cached, so that next time "foo" is accessed, we go straight for "foo.lnk",
> and keep using that while it exists.
>
> If someone has both "foo" and "foo.lnk" in the same directory,
> that's a bit of a degenerate case; how important is it to be "correct",
> anyway.

Question, mainly for Corinna:
Could the code be modified to use one |NtQueryDirectoryFile()| call
with a SINGLE pattern testing for { "foo", "foo.lnk", "foo.lnk.exe",
... } (instead of calling the kernel for each suffix independently)
and cache that information for the lifetime of the matching POSIX
function call ?
The idea is to reduce the number of userland<--->kernel roundstrips
from <n> to <1>, and filesystem drivers could be optimized even
further (for example if the network filesystem protocol supports file
name globbing...)

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

  reply	other threads:[~2023-12-24  0:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06  4:08 Dan Shelton
2023-12-18  6:22 ` Dan Shelton
2023-12-18  6:49   ` Marco Atzeri
2023-12-18  6:53     ` Dan Shelton
2023-12-18  7:05       ` Marco Atzeri
2023-12-18  7:16         ` Dan Shelton
2023-12-18  8:23           ` Marco Atzeri
2023-12-20 17:20   ` Kaz Kylheku
2023-12-21 12:16     ` rfe: CYGWIN fslinktypes option? " Martin Wege
2023-12-21 16:10       ` Cedric Blancher
2023-12-21 17:43         ` Brian Inglis
2023-12-21 20:32       ` Kaz Kylheku
2023-12-24  0:47         ` Roland Mainz [this message]
2024-01-08 14:53           ` Corinna Vinschen
2023-12-22 18:53       ` Andrey Repin

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='CAKAoaQnQ2eL9JJfn=CeJ06WujqgLdLVeXS7ojf7GvvmkB-KYoA@mail.gmail.com' \
    --to=roland.mainz@nrubsig.org \
    --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).