Re: A micro-optimisation for walkdir()
Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Munro <thomas.munro@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-02T15:51:27Z
Lists: pgsql-hackers
Attachments
- 0002-Add-d_type-to-WIN32-dirent-port.patch (application/octet-stream) patch 0002
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(). > Win32 could also benefit from this micro-optimisation if we expanded the dirent port to include d_type. Please find attached a patch that does so. Regards, Juan José Santamaría Flecha
Commits
-
Add d_type to our Windows dirent emulation.
- 87e6ed7c8c6a 14.0 landed
-
Skip unnecessary stat() calls in walkdir().
- 861c6e7c8e4d 14.0 landed