Re: [HACKERS] Kerberos 5 breakage. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Kerberos 5 breakage.
Date
Msg-id 20433.895698911@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Kerberos 5 breakage.  ("Matthew N. Dodd" <winter@jurai.net>)
List pgsql-hackers
"Matthew N. Dodd" <winter@jurai.net> writes:
> Also, allowing writes of single characters is bad; you incur a context
> switch each write.  The client and server should be writing things into
> largish buffers and writing those instead of doing small writes.

> The existence of the following scare me...
> pqPutShort(int integer, FILE *f)
> pqPutLong(int integer, FILE *f)
> [etc]

Look again.  Those functions use <stdio.h>, which provides buffering.
They don't need to do it themselves.

It might be good to put a layer underneath these functions to allow
insertion of encryption or something like that, but efficiency is not
a valid argument for doing it.

On the client side, in the recent libpq rewrite I took out usage of
stdio and did my own buffering instead, but that was just so that
I could control when and how the client would block for input.
I don't think it bought any speedup.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Hamish.N.MARSON@British-Airways.com
Date:
Subject: Bug in postgresql-6.3.2
Next
From: "Henry B. Hotz"
Date:
Subject: Re: [HACKERS] Kerberos 5 breakage.