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

Derry Shribman
Thu Oct 7 14:57:00 GMT 2010


>> In your original patch on the cygwin-patches ML you implemented the
>> fs_info caching using the pathname.  I still don't think this is correct
>> for the reasons given in another mail.  However, maybe we can use it
>> nevertheless like this:
>> - If we don't find a path prefix matching the incoming path, call
>>    symlink_info::check.
>> - Otherwise we have a cached fs_info for the path prefix:
>>    - If the path is NFS, call check.
>>    - Otherwise, if the calling function doesn't need st_nlink or st_mode,
>>      call xcheck.
>>    - Otherwise, call check.
>        - In check, test for samba and use GENERIC_WRITE
>        - otherwise use FILE_READ_ATTRIBUTES etc.
>> - In check and xcheck, always fetch fs_info using the current method.
>>    Write back to path-based cache so we use the info the next time
>>    around.

This looks like it will solve a lot of problems: it will choose the best method 
for each case, while using the cache to help decide quickly on the right method.

Yet another possible improvement on this line that could be implemented in the 
future after the fs_info caching is added:

We see that reading actual DATA from a file REALLY slow: on Windows with AV its 
slow due to the AV scanning the file, and on Network Shares (Samba/NFS) - it 
means create-read-close (3 round-trips) - as opposed to network-open-info (1 

Cygwin reads file content for symlinks (!<symlink>) and files that may be 
executable (#!/bin/xxx magic).

A cache could be added for this using the same cache mechanism. The 
cache-validation can be done with the quick QAF() (or QIF/QDF), and then the 
read the potential symlink/executable file's header only if needed.


More information about the Cygwin-developers mailing list