Implementing stat() with FindFirstFile()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any reason why compat/win32.h uses GetFileAttributesEx()
instead of FindFirstFile() to implement the stat() call on Windows?
The current implementation requires each queried file to be opened
and closed while FindFirstFile() only reads the directory.

I made a couple of test programs that stat()ed the 176k files on my
disk and got the following best times with GetFileAttributesEx() and
FindFirstFile() respectively:

./getfattr.exe < filelist.txt  1.31s user 9.72s system 27% cpu 40.424 total
./findfirst.exe < filelist.txt  1.92s user 13.98s system 95% cpu 16.681 total

I searched the archive and found a couple of threads touching upon the
subject, but nothing conclusive.

I have a (trivial) patch ready if such a change would be interesting.

-- 
Magnus Bäck
baeck@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux