Re: [PATCH] avoid double scanning in function byteain

2025-07-18 Thread Tom Lane
I wrote: > I'm inclined to accept 0001, reject 0002, and move on. This doesn't > seem like an area that's worth a huge amount of discussion. Done that way. I made a couple more cosmetic changes and added test cases for the double-backslash code path (which hadn't been covered in byteaout either,

Re: [PATCH] avoid double scanning in function byteain

2025-07-16 Thread Tom Lane
Peter Eisentraut writes: > The relationship between patch 0001 and 0002 is unclear to me. Are > these incremental or alternatives? The description doesn't make this clear. It appears to me that 0002 is actually counterproductive. I cannot see a reason to get a StringInfo involved here: it add

Re: [PATCH] avoid double scanning in function byteain

2025-05-21 Thread Peter Eisentraut
The relationship between patch 0001 and 0002 is unclear to me. Are these incremental or alternatives? The description doesn't make this clear. Some of the changes in patch 0002 just appear to move code and comments around without changing anything substantial. It's not clear why that is don

Re: [PATCH] avoid double scanning in function byteain

2025-05-09 Thread Aleksander Alekseev
Hi Stepan, > Sorry for the noise — I'm resending the patch because I noticed a compiler > warning related to mixed declarations and code, which I’ve now fixed. > > Apologies for the oversight in the previous submission. Thanks for the patch. As Kirill pointed out above, it would be nice if you

Re: [PATCH] avoid double scanning in function byteain

2025-05-09 Thread Stepan Neretin
On Fri, May 9, 2025 at 7:43 PM Aleksander Alekseev wrote: > Hi Stepan, > > > Sorry for the noise — I'm resending the patch because I noticed a > compiler warning related to mixed declarations and code, which I’ve now > fixed. > > > > Apologies for the oversight in the previous submission. > > Tha

Re: [PATCH] avoid double scanning in function byteain

2025-05-09 Thread Stepan Neretin
On Fri, May 9, 2025 at 5:24 PM Stepan Neretin wrote: > > > On Wed, Mar 26, 2025 at 9:39 PM Steven Niu wrote: > >> >> 在 2025/3/26 16:37, Kirill Reshke 写道: >> > On Wed, 26 Mar 2025 at 12:17, Steven Niu wrote: >> >> >> >> Hi, >> > >> > Hi! >> > >> >> This double scanning can be inefficient, especi

Re: [PATCH] avoid double scanning in function byteain

2025-05-09 Thread Stepan Neretin
On Fri, May 9, 2025 at 5:37 PM Stepan Neretin wrote: > > > On Fri, May 9, 2025 at 5:24 PM Stepan Neretin wrote: > >> >> >> On Wed, Mar 26, 2025 at 9:39 PM Steven Niu wrote: >> >>> >>> 在 2025/3/26 16:37, Kirill Reshke 写道: >>> > On Wed, 26 Mar 2025 at 12:17, Steven Niu wrote: >>> >> >>> >> Hi, >

Re: [PATCH] avoid double scanning in function byteain

2025-05-09 Thread Stepan Neretin
On Wed, Mar 26, 2025 at 9:39 PM Steven Niu wrote: > > 在 2025/3/26 16:37, Kirill Reshke 写道: > > On Wed, 26 Mar 2025 at 12:17, Steven Niu wrote: > >> > >> Hi, > > > > Hi! > > > >> This double scanning can be inefficient, especially for large inputs. > >> So I optimized the function to eliminate th

Re: [PATCH] avoid double scanning in function byteain

2025-03-26 Thread Steven Niu
在 2025/3/26 16:37, Kirill Reshke 写道: On Wed, 26 Mar 2025 at 12:17, Steven Niu wrote: Hi, Hi! This double scanning can be inefficient, especially for large inputs. So I optimized the function to eliminate the need for two scans, while preserving correctness and efficiency. While the arg

Re: [PATCH] avoid double scanning in function byteain

2025-03-26 Thread Kirill Reshke
On Wed, 26 Mar 2025 at 12:17, Steven Niu wrote: > > Hi, Hi! > This double scanning can be inefficient, especially for large inputs. > So I optimized the function to eliminate the need for two scans, > while preserving correctness and efficiency. While the argument that processing input once not

[PATCH] avoid double scanning in function byteain

2025-03-26 Thread Steven Niu
Hi, The byteain function converts a string input into a bytea type. The original implementation processes two input formats: a hex format (starting with \x) and a traditional escaped format. For the escaped format, the function scans the input string twice — once to calculate the exact size of th