Re: What to do with inline warnings?

Neil Conway <neilc@samurai.com>

From: Neil Conway <neilc@samurai.com>
To: Gregory Stark <stark@enterprisedb.com>
Cc: Martijn van Oosterhout <kleptog@svana.org>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter_e@gmx.net>, pgsql-hackers@postgresql.org
Date: 2008-05-16T00:12:39Z
Lists: pgsql-hackers
On Wed, 2008-05-14 at 20:25 +0100, Gregory Stark wrote:
> The Linux kernel does have some macros meant to mark unlikely branches
> (usually assertion failures) but I'm not sure how they work. And Gcc also has
> a few optimizations which are driven by profiling data but I it doesn't sound
> like this is one of them.

GCC's profile-driven optimization can be used to guide decisions about
both branch prediction/likelihood and function inlining. IMHO it is
definitely worth building the infrastructure to get Postgres builds with
profile-driven optimization -- certainly more maintainable and less
arbitrary than builtin_expect() and friends to me.

-Neil