symlinks in extended attributes

Corinna Vinschen
Tue Jul 4 13:56:00 GMT 2006

On Jul  4 13:32, Egor Duda wrote:
> Corinna Vinschen wrote:
> > Every symlink reading requires some sort of CreateFile/ReadFile/
> > CloseHandle sequence anyway.  Given that the other two symlink readers,
> > symlink_info::check_shortcut and symlink_info::check_sysfile are pretty
> > streamlined, I'm wondering about the advantage of keeping the info
> > another time in the EAs.  Is it supposed to be faster?  I guess it's
> > faster now than before (using NtQueryEaFile instead of BackupRead), but
> > is it so much faster than symlink_info::check_shortcut/check_sysfile
> > that it's actually worth to keep another code path?
> When i was implementing this functionality, i've checked symlink
> resolution speed with, IIRC, something like that:
> for x in `seq 10`; do for y in `seq 10` do; for z in `seq 10`; do
>   mkdir -p a$x/b$y/c$z
>   ln -s a$x link-a$x
>   ln -s a$x/b$y a$x/link-b$y
>   ln -s a$x/b$y/c$z a$x/b$y/link-c$z
> done; done; done
> and then run (with the cold cache, and with bash, to make sure that
> `test' is a built-in)
> for x in `seq 10`; do for y in `seq 10` do; for z in `seq 10`; do
>   if ! test -f link-a$x/link-b$y/link-c$z; then echo oops!; fi
> done; done; done
> The difference between EA and non-EA variants was somewhere around
> 30-50%. I think that it could be explained by the placement by NTFS of
> short EA's right into "i-node".
> I understand, that a lot could have been changed in cygwin (and in
> windows' ntfs driver) since then, so, probably the gain is not that big now.

I just tested this on 2K and XP, the former a VM, the latter a real
machine using a 8 times bigger directory tree.  It doesn't matter
whether I run the testscript after a reboot (definitely clean cache) or
if I run it just multiple times taking cache effects into account.  I
don't see a noticable difference in timing between reading from the
symlink, or reading directly from the symlink file content, using
shortcut files.  On the real XP maschine the timing seems to be even
slightly worse when reading from the EA, about 3%, but that's
statistically irrelevant I guess.

This is with my latest patches using native NT calls for reading EAs.
Looks like we can really drop it for this purpose.


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

More information about the Cygwin-developers mailing list