Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Joe Conway <mail@joeconway.com>
From: Joe Conway <mail@joeconway.com>
To: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Date: 2020-05-25T13:02:04Z
Lists: pgsql-hackers
On 5/12/20 8:06 AM, Joe Conway wrote: > I was doing some memory testing under fractional CPU allocations and it became > painfully obvious that the repeat() function needs CHECK_FOR_INTERRUPTS(). > > I exchanged a few emails offlist with Tom about it, and (at the risk of putting > words in his mouth) he agreed and felt it was a candidate for backpatching. > > Very small patch attached. Quick and dirty performance test: <snip> > While discussing the above, Tom also wondered whether we should add unlikely() > to the CHECK_FOR_INTERRUPTS() macro. > > Small patch for that also attached. I was not sure about the WIN32 stanza on > that (to do it or not; if so, what about the UNBLOCKED_SIGNAL_QUEUE() test). > > I tested as above with unlikely() and did not see any discernible difference, > but the added check might improve other code paths. > > Comments or objections? Seeing none ... I intend to backpatch and push these two patches in the next day or so. Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development
Commits
-
Add unlikely() to CHECK_FOR_INTERRUPTS()
- c5262cfd59cb 10.14 landed
- 3cbf4be3e0eb 11.9 landed
- 8401ad52350e 12.4 landed
- 87fb04af1e70 13.0 landed
-
Add CHECK_FOR_INTERRUPTS() to the repeat() function
- 36758c472ea7 11.9 landed
- 3ccae5445cc8 12.4 landed
- 887cdff4dcbd 13.0 landed
- bfb9595a786e 9.5.23 landed
- 28e2c6eacc69 9.6.19 landed
- 2cbe3a954219 10.14 landed