Mail Archives: cygwin/2001/01/03/09:39:25
Hi!
Wednesday, 03 January, 2001 Dan Morris dmorris AT tiqit DOT com wrote:
DM> Anyone know why this might be? I looked through the du code; the only
DM> repeated filesystem access seems to be through stat() and lstat(). So I
DM> looked through stat() and lstat(), and I can't see any place where disk
DM> flushes are explicitly forced, or any place where Win32 calls are made with
DM> specific flags for ignoring the inode cache ... these seem to be the Win32
DM> filesystem calls that get made :
DM> GetVolumeInformation
DM> GetDriveType
DM> GetFileInformationByHandle
DM> GetFileSize
DM> GetFileType
DM> FindFirstFile
DM> I don't know why any of them would ignore the cache... any ideas? I'm
DM> running Win2000, if that helps anyone...
They don't ignore cache, and there's no disk flushes.
GetFileInformationByHandle, however, requires opening file, which is
far more expensive than just obtaining it via
FindFirstFile/FindNextFile. moreover, cygwin tries to deduce if the
file is executable by file's header and this involves ReadFile. If
your filesystem contains a lot of symlinks, this makes things even
worse, because each symlink is resolved via ReadFile() too.
those performance tradeoffs were made to achieve semantical
correctness of *stat calls.
If you want to improve performance of du, you should patch its
sources. change all calls to stat to bunch of native win32 api calls
needed to get statbuf fields used later. something like this:
...
#if defined (__CYGWIN__)
...
statbuf.st_size = GetFileSize (file, &hwSize);
...
#else
rc = stat (file, &statbuf)
#endif
...
Egor. mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -