pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Fetter <david@fetter.org>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Why is pq_begintypsend so slow?
Date: Sat, 11 Jan 2020 22:32:45 -0500
Message-ID: <28764.1578799965@sss.pgh.pa.us> (raw)
In-Reply-To: <5450.1578797036@sss.pgh.pa.us>
References: <CAMkU=1whbRDUwa4eayD9+59K-coxO9senDkPRbTn3cg0pUz4AQ@mail.gmail.com>
	<31795.1578773977@sss.pgh.pa.us>
	<20200112014107.GC32763@fetter.org>
	<5450.1578797036@sss.pgh.pa.us>

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





view thread (29+ messages)  latest in thread

Message-ID: <28764.1578799965@sss.pgh.pa.us>
Permalink:  ../28764.1578799965@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28764.1578799965@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david@fetter.org, jeff.janes@gmail.com
  Subject: Re: Why is pq_begintypsend so slow?
  In-Reply-To: <28764.1578799965@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox