Skip to content

Instantly share code, notes, and snippets.

@rygorous
Created March 24, 2013 01:36
Embed
What would you like to do?
Exhibit A.
From: Casey Muratori, 10/17/12
Well, you will notice that that loop _does not_ stat unless it's
running on a filesystem that doesn't support readdir dtypes (because
it needs to know whether or not to recurse, which you can do with the
dtype on ext*, but not on NTFS et al, since they didn't bother to
implement it or something - everything comes back as DT_UNKNOWN). I
haven't looked at the code to find out if/where they actually do stat
as a matter of course elsewhere, but as I mentioned last night, it is
_only the stat_ that causes the catastrophic case. In my experiments,
readdir without stat is always extremely fast, cached or otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment