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
+2 -1
View File
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq.h,v 1.48 2001/11/05 17:46:33 momjian Exp $
* $Id: libpq.h,v 1.49 2001/12/04 19:40:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,6 +62,7 @@ extern void StreamClose(int sock);
extern void pq_init(void);
extern int pq_getbytes(char *s, size_t len);
extern int pq_getstring(StringInfo s);
extern int pq_getbyte(void);
extern int pq_peekbyte(void);
extern int pq_putbytes(const char *s, size_t len);
extern int pq_flush(void);