Re: A micro-optimisation for walkdir()

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: A micro-optimisation for walkdir()
Дата
Msg-id CA+hUKGLwi2m7cnsYE=g+f99TAgLtWvq1eTpPVJWHHJFxVNxkGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: A micro-optimisation for walkdir()  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Ответы Re: A micro-optimisation for walkdir()
Список pgsql-hackers
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!

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Fix for configure error in 9.5/9.6 on macOS 11.0 Big Sur
Следующее
От: "Andrey V. Lepikhov"
Дата:
Сообщение: Re: Ideas about a better API for postgres_fdw remote estimates