Re: Scanner performance (was Re: 7.3 schedule) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Scanner performance (was Re: 7.3 schedule)
Date
Msg-id 200204161755.g3GHtfO19314@candle.pha.pa.us
Whole thread Raw
In response to Re: Scanner performance (was Re: 7.3 schedule)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> The string literals didn't contain any backslashes, so scanstr is
> operating in the best-case scenario here.  But for arbitary binary data we
> need some escape mechanism, so I don't see much room for improvement
> there.
> 
> It seems the real bottleneck is the excessive abstraction in the
> communications layer.  I haven't looked closely at all, but it would seem
> better if pq_getstring would not use pq_getbyte and instead read the
> buffer directly.

I am inclined to agree with your analysis.  We added abstraction to
libpq because the old code was quite poorly structured.  Now that it is
well structured, removing some of the abstraction seems valuable.

Any chance pq_getbyte could be made into a macro?  I would be glad to
send you a macro version for testing.  I would have to push the while
loop into pg_recvbuf() and change the while in pg_getbyte to an if, or
as a macro, ? :.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Scanner performance (was Re: 7.3 schedule)
Next
From: Jan Wieck
Date:
Subject: Re: [GENERAL] Testers needed ...