|
From: | Christian Franke |
Subject: | Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ? |
Date: | Fri, 28 Nov 2008 00:26:22 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 |
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 Thread] | Current Thread | [Next in Thread] |