[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnulib-bug
Subject:    Re: [Patch] Add dirent.d_type support to  Cygwin 1.7 ?
From:       Christian Franke <Christian.Franke () t-online ! de>
Date:       2008-11-27 23:26:22
Message-ID: 492F2C9E.30301 () t-online ! de
[Download RAW message or body]

Eric Blake wrote:
>
> According to Christian Franke on 11/27/2008 2:41 PM:
>   
>> PS: find is not as smart as expected: 'find /path -type d' calls lstat()
>> for each entry, even if d_type != DT_UNKNOWN.
>> So 'find /path' is 2-3 times faster than 'find /path -type d'.
>>     
>
> This seems like it might be a bug in gnulib's fts implementation.  How
> does 'oldfind /path -type d' perform?  oldfind has the advantage of not
> using fts, so if it performs better, then there is a hole where we need to
> improve gnulib's fts to make directory-only or non-directory-only
> traversals use d_type for optimization.
>
>   

Performance of 'oldfind /path -type d' is actually similar to 'oldfind 
/path':

$ export TIMEFORMAT='%1R'

$ time find /cygdrive/c/cygwin >/dev/null
29.6

$ time find /cygdrive/c/cygwin -type d >/dev/null
29.5

$ time find-with-d_type /cygdrive/c/cygwin >/dev/null
10.4

$ time find-with-d_type /cygdrive/c/cygwin -type d >/dev/null
29.4


$ time oldfind /cygdrive/c/cygwin  >/dev/null
33.1

$ time oldfind /cygdrive/c/cygwin -type d >/dev/null
32.9

$ time oldfind-with-d_type /cygdrive/c/cygwin  >/dev/null
12.0

$ time oldfind-with-d_type /cygdrive/c/cygwin -type d >/dev/null
12.1


Christian




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic