Re: A micro-optimisation for walkdir() - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: A micro-optimisation for walkdir()
Date
Msg-id CAEudQAo7Pj=zrvaOKs=K05xR=Od9A6x-ru-SYa8qPoJxY3tXuw@mail.gmail.com
Whole thread Raw
In response to A micro-optimisation for walkdir()  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
Hi Juan,

This is only a suggestion, if you find it appropriate.
We could use a little cut tail in get_dirent_type function.

Try to avoid add padding, when modifying or adding fields.
struct dirent
 {
  long d_ino;
  unsigned short d_reclen;
  unsigned short d_namlen;
+ unsigned char d_type;
  char d_name[MAX_PATH];
 };

Or even better if possible:
struct dirent
 {
  char d_name[MAX_PATH];
  long d_ino;
  unsigned short d_reclen;
  unsigned short d_namlen;
  unsigned char d_type;
 };

regards,
Ranier Vilela

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dubious code in pg_rewind's process_target_file()
Next
From: Peter Geoghegan
Date:
Subject: Re: logtape.c stats don't account for unused "prefetched" block numbers