Re: Making aggregate deserialization (and WAL receive) functions slightly faster

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Making aggregate deserialization (and WAL receive) functions slightly faster
Date: 2023-10-04 03:57:29
Message-ID: ZRziqVmdKZXpqSTi@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 03, 2023 at 06:02:10PM +1300, David Rowley wrote:
> I know I said I'd drop this, but I was reminded of it again today. I
> ended up adjusting the patch so that it no longer adds a helper
> function to stringinfo.c and instead just manually assigns the
> StringInfo.data field to point to the bytea's buffer. This follows
> what's done in some existing places such as
> LogicalParallelApplyLoop(), ReadArrayBinary() and record_recv() to
> name a few.
>
> I ran a fresh set of benchmarks on today's master with and without the
> patch applied. I used the same benchmark as I did in [1]. The average
> performance increase from between 0 and 12 workers is about 6.6%.
>
> This seems worthwhile to me. Any objections?

Interesting.

+ buf.len = VARSIZE_ANY_EXHDR(sstate);
+ buf.maxlen = 0;
+ buf.cursor = 0;

Perhaps it would be worth hiding that in a macro defined in
stringinfo.h?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-10-04 04:26:23 Re: Synchronizing slots from primary to standby
Previous Message Peter Smith 2023-10-04 03:22:41 Re: Synchronizing slots from primary to standby