Re: A micro-optimisation for walkdir()

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-06T22:36:14Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> Excellent.  I'd like to commit these soon, unless someone has a better
> idea for how to name file_utils_febe.c.

As long as it's in src/port or src/common, isn't it implicit that
it's probably FE/BE common code?

I think it'd make more sense to insert all this stuff into file_utils.c,
and then just "#ifdef FRONTEND" the existing code there that doesn't work
in backend.  For one thing, that gives us a saner upgrade path whenever
somebody gets ambitious enough to make that code work for the backend.

			regards, tom lane



Commits

  1. Add d_type to our Windows dirent emulation.

  2. Skip unnecessary stat() calls in walkdir().