Re: [HACKERS] Postgres Speed or lack thereof - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Postgres Speed or lack thereof
Date
Msg-id 199901181234.HAA00107@candle.pha.pa.us
Whole thread Raw
In response to RE: [HACKERS] Postgres Speed or lack thereof  (Magnus Hagander <mha@sollentuna.net>)
List pgsql-hackers
> Could be because of that. I noticed that the backend calls pq_getchar() a
> _lot_ of times, looping for reading a single character. It did that before
> too. The difference was that pq_getchar() called fgetc() then, and calls
> recv() now.
> I don't know, maybe recv() is more expensive than fgetc()? But I really
> can't see any reason it shuold be called more often now than before.
> An interesting fact is that pq_getchar() doesn't show up at all. Could be
> because it's fast, but still executed many times, right? Or it could be that
> the 'inner loops' in pq_getchar(), pq_peekchar(), or pqGetNBytes() don't
> work as expected. On my system (Linux 2.2), I only get one recv() call for
> each entry into these functions - as it should be - might it be different on
> yours?

It is very possible that fgetc() is a macro on your platform.  See
/usr/include/stdio.h.  If so, it has no function call overhead.

On BSD/OS, it used to be a macro, but now with threads, it is not. They
have a macro version, but is under a different name.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@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: Bruce Momjian
Date:
Subject: Re: [HACKERS] I need a PostgreSQL vacation
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [HACKERS] Syntax errors in current tree