Linux likely() unlikely() for PostgreSQL - Mailing list pgsql-hackers

From wenhui qiu
Subject Linux likely() unlikely() for PostgreSQL
Date
Msg-id CAGjGUAKTON7s20zBxzn+SMAM-Ruv-kR17CsuM9uEmGebfh5igA@mail.gmail.com
Whole thread Raw
Responses Re: Linux likely() unlikely() for PostgreSQL  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
List pgsql-hackers
Hi Hackers
   When I saw this document:https://en.wikipedia.org/wiki/Branch_predictor, I thought of Linux likely() vs unlikely() and thus thought that there are some code segments in src/backend/executor/execMain.c that can be optimized.
For example :
if (ExecutorStart_hook)
(*ExecutorStart_hook) (queryDesc, eflags);
else
standard_ExecutorStart(queryDesc, eflags);
}
void
ExecutorRun(QueryDesc *queryDesc,
ScanDirection direction, uint64 count,
bool execute_once)
{
if (ExecutorRun_hook)
(*ExecutorRun_hook) (queryDesc, direction, count, execute_once);
else
standard_ExecutorRun(queryDesc, direction, count, execute_once);
}
###
if (unlikely(ExecutorRun_hook)),

I hope to get guidance from community experts,Many thanks

Thanks

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Extension using Meson as build system
Next
From: Matthias van de Meent
Date:
Subject: Re: Linux likely() unlikely() for PostgreSQL