diff options
| author | Tom Lane | 2001-12-04 19:40:17 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-12-04 19:40:17 +0000 |
| commit | f4bd04bb67c5da67b4fc35aa4da4ac47cff4cd66 (patch) | |
| tree | 60021bf58981f978795048a26038ab07702a9940 /src/backend/libpq | |
| parent | dae887abfe54b10820e03f0de82542306d825b00 (diff) | |
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...
Diffstat (limited to 'src/backend/libpq')
| -rw-r--r-- | src/backend/libpq/pqcomm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 181c46416b7..7a46961222c 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -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) |
