This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Followup on eliminating symlink ReadFile calls -- it's not necessary


I asserted yesterday that Cygwin Make was being slowed down by the
ReadFile calls necessary to determine if a file should be considered
executable and whether or not it's a symbolic link.  I was only half
right.

DJ Delorie suggested using "mount -x" to eliminate the ReadFile for
determining whether a file is executable, and adding a new mount
option to indicate that there are no symbolic links under a particular
mountpoint, to eliminate the other ReadFile.

I implemented his suggestion, adding a "-l" flag and a corresponding
MOUNT_NO_SYMLINKS flag, and did some performance testing on the
result.  I was surprise to discover that mounting with this option
didn't provide any additional performance improvement over "-x".

This inspired me to do a more careful reading of the code, at which
point I noticed what I should have noticed before -- the ReadFile to
check for a symbolic link doesn't happen unless the system attribute
is set on a file.  In other words, the performance hit we were seeing
in Make was due entirely to the ReadFile checking for executability,
NOT to the ReadFile checking for symbolic links.

Therefore, the current Cygwin already has the ability to eliminate
this performance hit -- you just need to mount filesystems with "-x",
and no additional changes to Cygwin are necessary.

Thanks to everyone who responded to my messages yesterday offering
suggestions that helped me track this down.

Given the magnitude of the performance improvement when "-x" is used,
I wonder if its use should be recommended in the documentation, or
perhaps it should even be the default behavior.

  jik

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]