Thread (32 messages) flat view 32 messages, 10 authors, 2016-06-15

Re: inotify to minimize stat() calls

From: Magnus Bäck <hidden>
Date: 2016-06-15 22:56:09

Possibly related (same subject, not in this thread)

On Sunday, February 10, 2013 at 08:26 EST,
     demerphq [off-list ref] wrote:
Is windows stat really so slow?
Well, the problem is that there is no such thing as "Windows stat" :-)
I encountered this perception in windows Perl in the past, and I know
that on windows Perl stat *appears* slow compared to *nix, because in
order to satisfy the full *nix stat interface, specifically the nlink
field, it must open and close the file*. As of 5.10 this can be
disabled by setting a magic var ${^WIN32_SLOPPY_STAT} to a true value,
which makes a significant improvement to the performance of the Perl
level stat implementation.  I would not be surprised if the cygwin
implementation of stat() has the same issue as Perl did, and that stat
appears much slower than it actually need be if you don't care about
the nlink field.
I suggested a few years ago that FindFirstFile() be used to implement
stat() since it's way faster than opening and closing the file, but
FindFirstFile() apparently produces unreliable mtime results when DST
shifts are involved.

http://thread.gmane.org/gmane.comp.version-control.git/114041
(The reference link in Johannes Sixt's first email is broken, but I'm
sure the information can be dug up.)

Based on a quick look it seems GetFileAttributesEx() is still used for
mingw and cygwin Git.

-- 
Magnus Bäck
baeck@google.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help