Re: [HACKERS] Postgres Speed or lack thereof

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: mha(at)sollentuna(dot)net (Magnus Hagander)
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Postgres Speed or lack thereof
Date: 1999-01-18 12:34:58
Message-ID: 199901181234.HAA00107@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 1999-01-18 12:35:27 Re: [HACKERS] Postgres Speed or lack thereof
Previous Message Bruce Momjian 1999-01-18 12:27:48 Re: [HACKERS] backend/utils/adt/float.c uses non-existent NAN value