Re: PQunescapeBytea tweak - Mailing list pgsql-patches

From Tom Lane
Subject Re: PQunescapeBytea tweak
Date
Msg-id 5593.1067569051@sss.pgh.pa.us
Whole thread Raw
In response to PQunescapeBytea tweak  (Adam Kavan <akavan@cox.net>)
Responses Re: PQunescapeBytea tweak
List pgsql-patches
Adam Kavan <akavan@cox.net> writes:
> This patch converts PQunescapeBytea from using arrays to the text string
> and to the output binary string to using pointers.  This makes it much
> faster than the older version for large Bytea's.

What compiler and optimization settings are you using, and what is the
hardware platform?  It seems strange to me that you would get any
noticeable speedup from this change.  Most C compilers are supposed to
be reasonably smart about optimizing subscripted pointers.

Also, how about using tmpbuf as the moving pointer, instead of
interchanging the roles of tmpbuf and buffer as you did?  That
seems a bit confusing.

Finally, as Bruce noted, we prefer diff -c output for patches.
It's safer to apply that way --- the plain diff format fails
too easily if there have been any nearby changes.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PQunescapeBytea tweak
Next
From: Larry Rosenman
Date:
Subject: UnixWare UP3 compiler detection patch