Re: Cleaning up and speeding up string functions

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker )
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cleaning up and speeding up string functions
Date: 2019-07-22 15:37:18
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker) writes:

> David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
>> On Thu, 4 Jul 2019 at 13:51, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> wrote:
>>> 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.
>> I've pushed this after having found a couple more places where the
>> length is known.
> I noticed a lot of these are appending one StringInfo onto another;
> would it make sense to introduce a helper funciton
> appendStringInfoStringInfo(StringInfo str, StringInfo str2) to avoid the
> `, str2.len` repetition?

A bit of grepping only turned up 18 uses, but I was bored and whipped up
the attached anyway, in case we decide it's worth it.

- ilmari
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live with
the consequences of." -- Skud's Meta-Law

Attachment Content-Type Size
0001-Add-appendStringInfoStringInfo-function.patch text/x-diff 8.9 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-07-22 15:41:05 Re: Cleaning up and speeding up string functions
Previous Message Alvaro Herrera 2019-07-22 15:33:01 Re: Add parallelism and glibc dependent only options to reindexdb