On Thu, Sep 3, 2020 at 3:52 AM Juan José Santamaría Flecha
<juanjo.santamaria@gmail.com> wrote:
> On Wed, Sep 2, 2020 at 4:35 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Thomas Munro <thomas.munro@gmail.com> writes:
>> > You don't need to call stat() just to find out if a dirent is a file
>> > or directory, most of the time. Please see attached.
>>
>> Hm. If we do this, I can see wanting to apply the knowledge in more
>> places than walkdir().
Good idea. Here's a new version that defines a new function
get_dirent_type() in src/common/file_utils_febe.c and uses it for both
frontend and backend walkdir().
> Win32 could also benefit from this micro-optimisation if we expanded the dirent port to include d_type. Please find
attacheda patch that does so.
Is GetFileAttributes() actually faster than stat()? Oh, I see that
our pgwin32_safestat() makes extra system calls. Huh. Ok then.
Thanks!