Re: Why is pq_begintypsend so slow? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why is pq_begintypsend so slow?
Date
Msg-id 28764.1578799965@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why is pq_begintypsend so slow?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Why is pq_begintypsend so slow?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
I wrote:
> I saw at this point that the remaining top spots were
> enlargeStringInfo and appendBinaryStringInfo, so I experimented
> with inlining them (again, see patch below).  That *did* move
> the needle: down to 72691 ms, or 20% better than HEAD.

Oh ... marking the test in the inline part of enlargeStringInfo()
as unlikely() helps quite a bit more: 66100 ms, a further 9% gain.
Might be over-optimizing for this particular case, perhaps, but
I think that's a reasonable marking given that we overallocate
the stringinfo buffer for most uses.

(But ... I'm not finding these numbers to be super reproducible
across different ASLR layouts.  So take it with a grain of salt.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [proposal] de-TOAST'ing using a iterator
Next
From: Tomas Vondra
Date:
Subject: Re: logical decoding : exceeded maxAllocatedDescs for .spill files