git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Implementing stat() with FindFirstFile()
@ 2009-03-21 15:47 Magnus Bäck
  2009-03-21 19:55 ` Johannes Sixt
  2009-04-01  9:28 ` Nazri Ramliy
  0 siblings, 2 replies; 14+ messages in thread
From: Magnus Bäck @ 2009-03-21 15:47 UTC (permalink / raw)
  To: git

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@swipnet.se

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-04-01  9:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-21 15:47 Implementing stat() with FindFirstFile() Magnus Bäck
2009-03-21 19:55 ` Johannes Sixt
2009-03-24 21:54   ` Magnus Bäck
2009-03-26  7:15     ` Johannes Sixt
2009-03-26 21:39       ` Magnus Bäck
2009-03-27  2:25         ` Johannes Schindelin
2009-03-29 22:48           ` Magnus Bäck
2009-03-30  0:52             ` Johannes Schindelin
2009-03-30  5:11               ` Björn Steinbrink
2009-03-30 22:07                 ` Heiko Voigt
2009-03-30 23:29                   ` Johannes Schindelin
2009-03-31 20:32                     ` Magnus Bäck
2009-03-31 20:49                       ` Johannes Schindelin
2009-04-01  9:28 ` Nazri Ramliy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).