On 02/06/2017 12:50, Craig Ringer wrote:
> On 2 Jun. 2017 16:42, "Hao Lee" <mixt...@gmail.com
> <mailto:mixt...@gmail.com>> wrote:
> Hi all,
> There is a lot of "if statement" in system, and GCC provides
> a feature,"__builtin_expect", which let compilers know which branch
> is mostly run.
> Compilers and CPUs are really good at guessing this.
> Humans are wrong about it more than we'd like too.
> It's surprisingly rarely s good idea to use branch prediction hints.
> See the vsrious Linux kernel discussions about this.
> If you find concrete sites of frequent or costly branch mis-prediction
> please point them out, with benchmarks.
And also see this thread:
BTW Andres added support for likely/unlikely in aa3ca5e3dd6, but its
usage is still really limited.
http://dalibo.com - http://dalibo.org
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: