X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A23E338582B1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1703378897;
	bh=DVgwuO5lEwMkwdZSn9oXWi4EKbeozg4CmMM1HcXTCMw=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=MUgcTB4LP1cI7RDqccJAbEIJtfj4/0MPeTd/4+kmtIG7iqfP67zn1WXX4ZJD6cUWL
	 9lYRR5MFeZccfBhjspLGD/+r3favdIh4jBaXLQrLWgKPsa7e+wIXDtmowVi/IjEA70
	 Y4X6EjWY+68f9yV0sRRC6F7ZndPqF/hRJ3yqIN5I=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4613938582A6
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4613938582A6
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703378860; cv=none;
 b=OlOUMrZmEQMMPttXyyS0vgrnXXs6evAn2MCRqGuacM2PfVKudbZS6ovDuTTwdbwCX0Mq4aQAS84AaA5CRM/4CaILA12W8z9o8Lyl0YY3qo0Xh6QXmrGQZY9Bix1VZMdxBUrm3ilpRuWza8v+Li7eXKtJMUeL14lJsZobdKaEvxI=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1703378860; c=relaxed/simple;
 bh=qx4p5c78CRjJgqrG6R3mEoh+gEXYd/KzYnYi8yu6BLc=;
 h=MIME-Version:From:Date:Message-ID:Subject:To;
 b=FCpNfkCAs8MCnHU18l0nHjXUJrzZFpgjwIPtOgKtcLeitgZhaBPE2070pRDvJeBks4NDlv+IqHYWDMIgwfb2QFU7UxRHnLGW7a1XUlqrr81t2Ka+xojFmzd+LAH30RkyNNWbbqMriPd6x2ecVef8nlKDyAEgSnsNhkB1GFW1EcI=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703378855; x=1703983655;
 h=content-transfer-encoding:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=8GnMwlKpfhY5JvaBhxxnUk2nFC/47olH2b/1enJpJs4=;
 b=gz7qTJooMFLGeOr9QjZSZOoXezyV6aqWpzBAnvR1gJtFzhVanMQagK5ZYQg8uJMMhA
 IIIP9KtW4VGjC+sjQ5Bck2syLnei+vUtFfAocq6sL6wPAVeCFefLXhRl3gHc8cNc5JCr
 byTSOjowSXflivSUtZ2edG+aoquq1ETAS9B5gzrwuCcyMhuzfhyUOzyhnFdIp3R0xMpM
 BJCyeEDHppUO18x5i/ed4nXJnXZ8Oh/PWHNlZSCOWSEk068iwrCOxe1WiDhftFRr2suA
 R5xsc5v0dzvlYGfNBVBbxUwYXa7wXTS9e3ECWwrBkUuMjRKKU4V2fDwI9ziH/g0etWmb
 G00g==
X-Gm-Message-State: AOJu0YyryNLJtTZWpal6WZPd+WlxPLnfDRzo2UsAksgJnc++gvgwgSn8
 whaCGVT0YuWN+Czvh40Sysv3eeAN6h7MLzyyEnyX9zBoxUI=
X-Google-Smtp-Source: AGHT+IFtEjRkkuWayz3djnb44LHtq6vhqOyjkcDNagGoski/0Sg/awKI8PBE9ofHx21Sx5FwxWeVYxmhE1PdbDrdrKA=
X-Received: by 2002:a92:ca0e:0:b0:35d:59a2:bd2 with SMTP id
 j14-20020a92ca0e000000b0035d59a20bd2mr3426887ils.104.1703378855416; Sat, 23
 Dec 2023 16:47:35 -0800 (PST)
MIME-Version: 1.0
References: <CAAvCNcBZGepZMP9Q0D5ua+6ACftDOQEriqnuCbwg6umBPUA72Q@mail.gmail.com>
 <CAAvCNcB0_0ZeujP23QZFZaDvVTh5rxbXJw4FP6uXNPErCgdZ2w@mail.gmail.com>
 <07c7379e983c9f436ebf86e3818ca843@kylheku.com>
 <CANH4o6OjJJZQkbELt+H3WdAxQbLGZ1DL0ytevknRpbTO9sVUig@mail.gmail.com>
 <4723aab7e2b331cb81946eff0fb4e862@kylheku.com>
In-Reply-To: <4723aab7e2b331cb81946eff0fb4e862@kylheku.com>
Date: Sun, 24 Dec 2023 01:47:09 +0100
Message-ID: <CAKAoaQnQ2eL9JJfn=CeJ06WujqgLdLVeXS7ojf7GvvmkB-KYoA@mail.gmail.com>
Subject: Re: rfe: CYGWIN fslinktypes option? Re: Catastrophic Cygwin find .
 -ls, grep performance on samba share compared to WSL&Linux
To: cygwin@cygwin.com
X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,
 FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,
 KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,
 SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Roland Mainz via Cygwin <cygwin@cygwin.com>
Reply-To: Roland Mainz <roland.mainz@nrubsig.org>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3BO0mJ5Z026468

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;)

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

