Re: Improve a few appendStringInfo calls new to v18

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: David Rowley <dgrowleyml@gmail.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2025-04-10T14:51:53Z
Lists: pgsql-hackers
On Thu, Apr 10, 2025 at 11:24:36AM +0300, Heikki Linnakangas wrote:
> On 10/04/2025 06:51, David Rowley wrote:
>> Any objections to doing this soonish? Or in a few weeks?
> 
> Sure, let's do it. Why would we wait?

+1.  You did something similar for v17 (commit 8461424), and it seems like
an entirely reasonable post-feature-freeze routine to me.

This probably isn't v18 material, but this reminds me of my idea to change
appendStringInfoString() into a macro for appendBinaryStringInfo() so that
the compiler can remove the runtime strlen() calls for string literals [0].
In most cases, the benefits are probably negligible, but StringInfo is
sometimes used in hot paths.

[0] https://postgr.es/m/20231218164135.GA530790%40nathanxps13

-- 
nathan



Commits

  1. Improve various new-to-v18 appendStringInfo calls

  2. Fixup various StringInfo function usages