Re: Keep elog(ERROR) and ereport(ERROR) calls in the cold path

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Keep elog(ERROR) and ereport(ERROR) calls in the cold path
Date: 2020-09-04 20:36:55
Message-ID: 9c4d2ed3-fa00-4610-ef7e-f22bd2f3a3b0@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-08-05 05:00, David Rowley wrote:
> The 5GB scaled TPC-H test does show some performance gains from the v4
> patch and shows an obvious regression from removing the unlikely()
> calls too.
>
> Based, mostly on the TPC-H results where performance did improve close
> to 2%, I'm starting to think it would be a good idea just to go for
> the v4 patch. It means that future hot elog/ereport calls should make
> it into the cold path.

Something based on the v4 patch makes sense.

I would add DEBUG1 back into the conditional, like

if (__builtin_constant_p(elevel) && ((elevel) >= ERROR || (elevel) <=
DEBUG1) ? \

Also, for the __has_attribute handling, I'd prefer the style that Andres
illustrated earlier, using:

#ifndef __has_attribute
#define __has_attribute(attribute) 0
#endif

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-09-04 20:41:47 Re: Questionable ping logic in LogicalRepApplyLoop
Previous Message Juan José Santamaría Flecha 2020-09-04 20:34:17 Re: A micro-optimisation for walkdir()