On Fri, 1 Sept 2023 at 13:00, Corinna Vinschen via Cygwin <cygwin@cygwin.com> wrote: > > On Sep 1 06:23, Cedric Blancher via Cygwin wrote: > > Good morning! > > > > During a Cygwin 3.4.8-1.x86_64 debugging session I noticed something > > odd when I looked at the network traffic generated by one of our > > cluster nodes: > > It seems that for each call to a tool (i.e. starting "sed" from > > "bash") Cygwin searches for *.lnk files. > > > > Is this correct even when the filesystem in question has native > > symlink support (e.g. NFS)? > > Yes. During file handling, Cygwin doesn't know what filesystem a > file is on until it could actually open the file and request file > and filesystem info from the open handle. So if Cygwin couldn't open > "foo" because the NtCreateFile call returned with status > STATUS_OBJECT_PATH_NOT_FOUND or STATUS_OBJECT_NAME_NOT_FOUND, or > STATUS_NO_SUCH_FILE, or one of the countless other status codes the > kernel (or the driver) might return in case a file doesn't exist, > it will tack on .lnk and .exe and, for historical reasons, .exe.lnk, > and try again.
Our concern here is that this produces an absurd amount of extra syscalls (6x more!!, compared to native POSIX), which hurts CIFS and NFS performance. The example with calling sed in a script is especially BAD, as trying to execute "sed" in a bash shell script leads it try for sed.exe, sed.sh, sed.bat, multiplied by looking for *.lnk files (i.e. sed.exe.lnk, sed.sh.lnk, sed.bat.lnk). And what finally made my brain go BOOM was the (IMO) absurd combination like "sed.bat.exe.lnk" Ced -- Cedric Blancher <cedric.blanc...@gmail.com> [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur -- 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