From: "Magnus Bäck" <baeck@swipnet.se>
To: git@vger.kernel.org
Subject: Implementing stat() with FindFirstFile()
Date: Sat, 21 Mar 2009 16:47:38 +0100 [thread overview]
Message-ID: <20090321154738.GA27249@jeeves.jpl.local> (raw)
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
next reply other threads:[~2009-03-21 15:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-21 15:47 Magnus Bäck [this message]
2009-03-21 19:55 ` Implementing stat() with FindFirstFile() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090321154738.GA27249@jeeves.jpl.local \
--to=baeck@swipnet.se \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).