1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easier

to use and significantly faster.  This tweak saves 25% (!) of the runtime
of COPY IN in a test with 8000-character lines.  I wouldn't normally
commit a performance improvement this late in the cycle, but 25% got
my attention...
This commit is contained in:
Tom Lane
2001-12-04 19:40:17 +00:00
parent dae887abfe
commit f4bd04bb67
4 changed files with 20 additions and 25 deletions

View File

@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.c,v 1.124 2001/11/12 04:54:08 tgl Exp $
* $Id: pqcomm.c,v 1.125 2001/12/04 19:40:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,6 +47,7 @@
* low-level I/O:
* pq_getbytes - get a known number of bytes from connection
* pq_getstring - get a null terminated string from connection
* pq_getbyte - get next byte from connection
* pq_peekbyte - peek at next byte from connection
* pq_putbytes - send bytes to connection (not flushed until pq_flush)
* pq_flush - flush pending output
@@ -527,7 +528,7 @@ pq_recvbuf(void)
* pq_getbyte - get a single byte from connection, or return EOF
* --------------------------------
*/
static int
int
pq_getbyte(void)
{
while (PqRecvPointer >= PqRecvLength)