> On 21 Jun 2022, at 16:59, Jakub Wartak <jakub.wartak@tomtom.com> wrote:
Oh, wow, your benchmarks show really impressive improvement.
> I think that 1 additional syscall is not going to be cheap just for non-standard OS configurations
Also we can reduce number of syscalls by something like
#if defined(USE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
if ((readOff % (8 * XLOG_BLCKSZ)) == 0)
posix_fadvise(readFile, readOff + XLOG_BLCKSZ, XLOG_BLCKSZ * 8, POSIX_FADV_WILLNEED);
#endif
and maybe define\reuse the some GUC to control number of prefetched pages at once.
Best regards, Andrey Borodin.