Cygwin Filesystem Performance degradation 1.7.5 vs 1.7.7, and methods for improving performance

Corinna Vinschen
Thu Oct 7 15:05:00 GMT 2010

On Oct  7 16:36, Derry Shribman wrote:
> Hi,
> >What's really strange is the fact that the non-GENERIC_READ version is
> >noticable *slower* when accessing a Samba share.  I checked the access
> >with sysinternal's Procmon, but apart from the different acesss flags,
> >eveything else is identical.  Very strange, that.
> >[...]
> For network shares (SAMBA), opening any handle, even a
> non-GENERIC_READ handle requires a round-trip to the SAMBA server
> over the network. This could easily be 1ms for LAN (and much much
> more for WAN). And only after you have the handle you can query it.
> So thats what the "open network file information" structures and
> APIs are: for network shares that the additional round-trip for
> CreateFile/CloseFile makes it slower.
> ---------------------------------------------------------------
> If so, what is needed is that lstat() will do QIF/QDF() for local
> shares, and QAF() for network shares.

That doesn't help.  It might be a help for outmoded systems like XP, but
it doesn't differ from QIF on Vista and later.  Even for network drives,
from procmon on W7:

0	16:59:50,6332763	x.exe	2960	FASTIO_NETWORK_QUERY_OPEN	\\calimero\corinna\t3.c	FAST IO DISALLOWED	
1	16:59:50,6349281	x.exe	2960	IRP_MJ_CREATE	\\calimero\corinna\t3.c	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
2	16:59:50,6420802	x.exe	2960	FASTIO_QUERY_INFORMATION	\\calimero\corinna\t3.c	FAST IO DISALLOWED	Type: QueryBasicInformationFile
3	16:59:50,6421872	x.exe	2960	IRP_MJ_QUERY_INFORMATION	\\calimero\corinna\t3.c	SUCCESS	Type: QueryBasicInformationFile, CreationTime: 13.09.2010 14:02:22, LastAccessTime: 04.10.2010 20:51:32, LastWriteTime: 13.09.2010 14:02:22, ChangeTime: 13.09.2010 14:02:22, FileAttributes: N
4	16:59:50,6422788	x.exe	2960	IRP_MJ_CLEANUP	\\calimero\corinna\t3.c	SUCCESS	
5	16:59:50,6427853	x.exe	2960	IRP_MJ_CLOSE	\\calimero\corinna\t3.c	SUCCESS	

Note especially that the file gets opened for FILE_READ_ATTRIBUTES
access only, so this case doesn't differ from what Cygwin does anyway.

It also does not matter whether the drive is mounted via a drive letter
or if the call uses an UNC path.  I don't see that this special case has
any future.


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