Re: [PATCH] pg_convert improvement

2023-12-04 Thread Nathan Bossart
Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: [PATCH] pg_convert improvement

2023-12-01 Thread Nathan Bossart
On Mon, Nov 27, 2023 at 08:11:06AM +0100, Drouvot, Bertrand wrote: > + PG_RETURN_BYTEA_P(string); I looked around to see whether there was some sort of project policy about returning arguments without copying them, but the only strict rule I see is to avoid scribbling on argument data

Re: [PATCH] pg_convert improvement

2023-11-27 Thread Drouvot, Bertrand
Hi, On 11/28/23 2:16 AM, Yurii Rashkovskii wrote:  Hi Bertrand, Did some minor changes in the attached: - Started the multi-line comment with an upper case and finished it with a "." and re-worded a bit. - Ran pgindent What do you think about the attached? It looks

Re: [PATCH] pg_convert improvement

2023-11-27 Thread Yurii Rashkovskii
Hi Bertrand, > Did some minor changes in the attached: > > - Started the multi-line comment with an upper case and finished > it with a "." and re-worded a bit. > - Ran pgindent > > What do you think about the attached? > It looks great! > > Also, might be good to create a CF entry [1] so

Re: [PATCH] pg_convert improvement

2023-11-26 Thread Drouvot, Bertrand
Hi, On 11/24/23 3:32 PM, Yurii Rashkovskii wrote: Hi Bertrand, On Fri, Nov 24, 2023 at 6:26 AM Drouvot, Bertrand mailto:bertranddrouvot...@gmail.com>> wrote: The patch is pretty straightforward, I just have one remark: +       /* if no actual conversion happened, return the original

Re: [PATCH] pg_convert improvement

2023-11-24 Thread Yurii Rashkovskii
Hi Bertrand, On Fri, Nov 24, 2023 at 6:26 AM Drouvot, Bertrand < bertranddrouvot...@gmail.com> wrote: > > The patch is pretty straightforward, I just have one remark: > > + /* if no actual conversion happened, return the original string */ > + /* (we are checking pointers to strings

Re: [PATCH] pg_convert improvement

2023-11-24 Thread Drouvot, Bertrand
Hi, On 11/24/23 3:05 PM, Yurii Rashkovskii wrote: Hi, I propose a patch that ensures `pg_convert` doesn't allocate and copy data when no conversion is done. It is an unnecessary overhead, especially when such conversions are done frequently and for large values. +1 for the patch, I think

[PATCH] pg_convert improvement

2023-11-24 Thread Yurii Rashkovskii
Hi, I propose a patch that ensures `pg_convert` doesn't allocate and copy data when no conversion is done. It is an unnecessary overhead, especially when such conversions are done frequently and for large values. I've tried measuring the performance impact, and the patched version has a small