Re: [HACKERS] An unlikely() experiment

2017-10-30 Thread David Rowley
On 30 October 2017 at 22:44, Andres Freund wrote: > On 2017-10-30 22:39:01 +1300, David Rowley wrote: >> Today I was thinking, to get around that issue, we might be able to >> generate another thin wrapper around elog_start() and mark that as >> __attribute__((cold)) and fudge

Re: [HACKERS] An unlikely() experiment

2017-10-30 Thread Andres Freund
On 2017-10-30 22:39:01 +1300, David Rowley wrote: > On 30 October 2017 at 22:34, Andres Freund wrote: > > Hi, > > > > On 2015-12-20 02:49:13 +1300, David Rowley wrote: > >> Alternatively, if there was some way to mark the path as cold from within > >> the path, rather than

Re: [HACKERS] An unlikely() experiment

2017-10-30 Thread David Rowley
On 30 October 2017 at 22:34, Andres Freund wrote: > Hi, > > On 2015-12-20 02:49:13 +1300, David Rowley wrote: >> Alternatively, if there was some way to mark the path as cold from within >> the path, rather than from the if() condition before the path, then we >> could perhaps

Re: [HACKERS] An unlikely() experiment

2017-10-30 Thread Andres Freund
Hi, On 2015-12-20 02:49:13 +1300, David Rowley wrote: > Alternatively, if there was some way to mark the path as cold from within > the path, rather than from the if() condition before the path, then we > could perhaps do something in the elog() macro instead. I just couldn't > figure out a way

Re: [HACKERS] An unlikely() experiment

2016-07-19 Thread Andres Freund
On 2015-12-20 14:21:14 +1300, David Rowley wrote: > On 20 December 2015 at 03:06, Andres Freund wrote: > > One way to do this would be to add elog_on() / ereport_on() macros, > > directly containing the error message. Like > > #define elog_on(cond, elevel, ...) \ > >

Re: [HACKERS] An unlikely() experiment

2015-12-19 Thread David Rowley
On 20 December 2015 at 03:06, Andres Freund wrote: > On 2015-12-20 02:49:13 +1300, David Rowley wrote: > > So I choose to ignore that, and give > > it a try anyway... elog(ERROR) for example, surely that branch should > > always be in a cold path? ... ereport() too perhaps? >

Re: [HACKERS] An unlikely() experiment

2015-12-19 Thread Andres Freund
Hi, On 2015-12-20 02:49:13 +1300, David Rowley wrote: > Many of you might know of GCC's __builtin_expect() and that it allows us to > tell the compiler which code branches are more likely to occur. It also tells the reader that, which I find also rather helpful. > The documentation on this