Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-18 Thread Michael Paquier
On Wed, Aug 18, 2021 at 09:14:14AM +0900, Michael Paquier wrote: > Sure. aef8948 gets down because of the performance impact. ccf4e27 > was a cleanup following up aef8948, that loses its meaning. And > c3826f8 cannot be let alone because of the reasons why aef8948 was > introduced, as it has no

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Michael Paquier
On Tue, Aug 17, 2021 at 09:39:30AM -0400, Tom Lane wrote: > OK, but the commit message should explain why they're getting reverted. Sure. aef8948 gets down because of the performance impact. ccf4e27 was a cleanup following up aef8948, that loses its meaning. And c3826f8 cannot be let alone beca

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Michael Paquier
On Wed, Aug 18, 2021 at 12:34:45AM +0800, Julien Rouhaud wrote: > On Tue, Aug 17, 2021 at 11:26 PM Bruce Momjian wrote: >> Uh, I don't see those commits, e.g.: >> >> $ git diff 0d70d30 >> fatal: ambiguous argument '0d70d30': unknown revision or path not in >> the working tree. >>

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Julien Rouhaud
On Tue, Aug 17, 2021 at 11:26 PM Bruce Momjian wrote: > > On Tue, Aug 17, 2021 at 09:39:30AM -0400, Tom Lane wrote: > > Michael Paquier writes: > > > In short, I am planning to address this regression with the attached, > > > for a combined revert of 0d70d30, 5c33ba5 and 92436a7. > > > > OK, but

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Bruce Momjian
On Tue, Aug 17, 2021 at 09:39:30AM -0400, Tom Lane wrote: > Michael Paquier writes: > > In short, I am planning to address this regression with the attached, > > for a combined revert of 0d70d30, 5c33ba5 and 92436a7. > > OK, but the commit message should explain why they're getting reverted. Uh,

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Tom Lane
Michael Paquier writes: > In short, I am planning to address this regression with the attached, > for a combined revert of 0d70d30, 5c33ba5 and 92436a7. OK, but the commit message should explain why they're getting reverted. regards, tom lane

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-17 Thread Ranier Vilela
Em ter., 17 de ago. de 2021 às 00:43, Michael Paquier escreveu: > On Mon, Aug 16, 2021 at 02:06:31PM -0300, Ranier Vilela wrote: > > uint64 and size_t in 64 bits are equivalents. > > uint64 and size_t in 32 bits can be weird, but anyway size_t at 32 bits > can > > handle 1GB. > > There is usually

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Michael Paquier
On Mon, Aug 16, 2021 at 02:06:31PM -0300, Ranier Vilela wrote: > uint64 and size_t in 64 bits are equivalents. > uint64 and size_t in 32 bits can be weird, but anyway size_t at 32 bits can > handle 1GB. There is usually a reason why things are done as they are, so before suggesting changing someth

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Michael Paquier
On Sun, Aug 15, 2021 at 02:58:59PM +, Hans Buschmann wrote: > If it seems useful somebody could enter it as an open item / > resolved item for pg14 after beta 3. Hmm. Using SQLs like the following to stress pg_hex_encode(), I can see a measurable difference easily, so no need of pg_dump or an

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Ranier Vilela
Em seg., 16 de ago. de 2021 às 13:19, Hans Buschmann escreveu: > -- > *Von:* Ranier Vilela > *Gesendet:* Montag, 16. August 2021 17:04 > *An:* Hans Buschmann > *Cc:* pgsql-hack...@postgresql.org > *Betreff:* Re: PG14: Avoid checking output-buffe

AW: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Hans Buschmann
Von: Ranier Vilela Gesendet: Montag, 16. August 2021 17:04 An: Hans Buschmann Cc: pgsql-hack...@postgresql.org Betreff: Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode Hello Ranier, Thank you for your quick response

Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Ranier Vilela
Welcome. Em seg., 16 de ago. de 2021 às 05:46, Hans Buschmann escreveu: > During some development on encoding-related parts of postgres I stumbled > over the new length-checking-code in common/hex.c/pg_hex_encode. > > Differently when comparing it to all versions before the > output-buffer-lengt

PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode

2021-08-16 Thread Hans Buschmann
During some development on encoding-related parts of postgres I stumbled over the new length-checking-code in common/hex.c/pg_hex_encode. Differently when comparing it to all versions before the output-buffer-length is checked during encoding of every individual source byte. This may impose qui