Re: Cleaning up and speeding up string functions

David Rowley <david.rowley@2ndquadrant.com>

From: David Rowley <david.rowley@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-07-04T01:51:06Z
Lists: pgsql-hackers

Attachments

On Sun, 26 May 2019 at 04:50, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <david.rowley@2ndquadrant.com> writes:
> > Here's a small patch series aimed to both clean up a few misuses of
> > string functions and also to optimise a few things along the way.
>
> > 0001: Converts various call that use appendPQExpBuffer() that really
> > should use appendPQExrBufferStr().  If there's no formatting then
> > using the former function is a waste of effort.
>
> > 0002: Similar to 0001 but replaces various appendStringInfo calls with
> > appendStringInfoString calls.
>
> Agreed on these; we've applied such transformations before.

I've pushed 0001 and 0002.

Instead of having 0004, how about the attached?

Most of the calls won't improve much performance-wise since they're so
cheap anyway, but there is xmlconcat(), I imagine that should see some
speedup.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Commits

  1. Use appendBinaryStringInfo in more places where the length is known

  2. Use appendStringInfoString and appendPQExpBufferStr where possible