Re: Speedup usages of pg_*toa() functions - Mailing list pgsql-hackers

From David Rowley
Subject Re: Speedup usages of pg_*toa() functions
Date
Msg-id CAApHDvp04HAxSfi3MZUp2kYsiOjhbv-d3kZorS1v_Wj0uHwv8w@mail.gmail.com
Whole thread Raw
In response to Re: Speedup usages of pg_*toa() functions  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Speedup usages of pg_*toa() functions
List pgsql-hackers
On Wed, 10 Jun 2020 at 11:57, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Tue, 9 Jun 2020 at 22:08, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
> >
> > >>>>> "David" == David Rowley <dgrowleyml@gmail.com> writes:
> >
> >  David> This allows us to speed up a few cases. int2vectorout() should
> >  David> be faster and int8out() becomes a bit faster if we get rid of
> >  David> the strdup() call and replace it with a palloc()/memcpy() call.
> >
> > What about removing the memcpy entirely? I don't think we save anything
> > much useful here by pallocing the exact length, rather than doing what
> > int4out does and palloc a fixed size and convert the int directly into
> > it.
>
> The attached 0001 patch does this.

Pending any objections, I'd like to push both of these patches in the
next few days to master.

Anyone object to changing the signature of these functions in 0002, or
have concerns about allocating the maximum memory that we might
require in int8out()?

David



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Resetting spilled txn statistics in pg_stat_replication
Next
From: Amit Kapila
Date:
Subject: Re: Parallel Seq Scan vs kernel read ahead