From: Andrew Main <zefram@tao.co.uk>
To: hzoli@frontiernet.net (Zoltan Hidvegi)
Cc: jdz@grogg.engr.sgi.com, zsh-workers@math.gatech.edu
Subject: Re: 3.1.2 beta bug
Date: Tue, 22 Jul 1997 09:35:05 +0100 (BST) [thread overview]
Message-ID: <199707220835.JAA20961@taos.demon.co.uk> (raw)
In-Reply-To: <199707211951.PAA25628@node5.frontiernet.net> from "Zoltan Hidvegi" at Jul 21, 97 03:51:52 pm
Zoltan Hidvegi wrote:
>As an experiment, 3.1.2 has leaf optimization. It is assumed that a
>directory has no subdirectories if a directory has a link count less than
>2. This optimization is also used by GNU find as I know. Too bad that
>it does not work, since it can speed up some searches a lot (especially
>**/file type pattern globs).
find has an option "-noleaf" to disable the optimisation. Perhaps we
need a similar option in zsh?
> Maybe a test for nlink == 2 instead of <= 2
>would help. A filesystem without the usual Unix directory link count
>semantics would probably have link count 1 for directories.
No, not really. Under Linux:
% ls -ld /proc /proc/*(/)
dr-xr-xr-x 5 root root 0 Apr 30 22:29 /proc
dr-xr-xr-x 3 root root 0 Jul 22 09:27 /proc/1
dr-xr-xr-x 3 root root 0 Jul 22 09:27 /proc/11688
dr-xr-xr-x 3 root root 0 Jul 22 09:27 /proc/12
dr-xr-xr-x 3 root root 0 Jul 22 09:27 /proc/13
[many other processes]
dr-xr-xr-x 2 root root 0 Jul 22 08:44 /proc/net
dr-xr-xr-x 2 root root 0 Jul 22 09:27 /proc/scsi
dr-xr-xr-x 5 root root 0 Jul 22 09:27 /proc/sys
The link count of 5 on /proc suggests three subdirectories, whereas it
actually has many more. Even if zsh isn't doing that form of leaf
optimisation, the fact remains that a directory can easily have a
meaningful but wrong link count. Not to mention the possibility of
a directory actually having multiple links other than . and .. (more
useful than one might imagine).
Leaf optimisation, though powerful, is of use in such limited
circumstances that it is almost useless.
-zefram
next prev parent reply other threads:[~1997-07-22 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-21 19:25 Jesse Zbikowski
1997-07-21 19:51 ` Zoltan Hidvegi
1997-07-22 8:35 ` Andrew Main [this message]
1997-07-22 11:12 ` Geoff Wing
1997-07-22 17:24 ` Zoltan T. Hidvegi
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=199707220835.JAA20961@taos.demon.co.uk \
--to=zefram@tao.co.uk \
--cc=hzoli@frontiernet.net \
--cc=jdz@grogg.engr.sgi.com \
--cc=zsh-workers@math.gatech.edu \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).