agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use stack-allocated StringInfoDatas, where possible
Date: Sun, 12 Apr 2026 22:43:54 +0000
Message-ID: <E1wC3Wz-000heo-2M@gemulon.postgresql.org> (raw)

Use stack-allocated StringInfoDatas, where possible

6d0eba662 already did most of the changes, but some new ones snuck in
just prior to that commit, so these got missed.

Having these short-lived StringInfoDatas on the stack rather than having
them get palloc'd by makeStringInfo() is simply for performance as it
saves doing a 2nd palloc.

Since this code is new to v19, it makes sense to improve it now rather
than wait until we branch as having v19 and v20 differ here just makes it
harder to backpatch fixes in this area.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/adt4wpj4FZwR+S7I@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a63bbc811d41b3567eb37fe2636e660a852dbbf2

Modified Files
--------------
src/backend/replication/logical/sequencesync.c | 39 ++++++++++++++------------
1 file changed, 21 insertions(+), 18 deletions(-)



view thread (2+ messages)

Message-ID: <E1wC3Wz-000heo-2M@gemulon.postgresql.org>
Permalink:  ../E1wC3Wz-000heo-2M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wC3Wz-000heo-2M@gemulon.postgresql.org

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-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use stack-allocated StringInfoDatas, where possible
  In-Reply-To: <E1wC3Wz-000heo-2M@gemulon.postgresql.org>

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

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