Re: Shave a few instructions from child-process startup sequence - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: Shave a few instructions from child-process startup sequence
Date
Msg-id CABwTF4Uc+MpK4Bf8RtCNN5wfKBWBWd5x2xr_iZw3SR_etMi9FA@mail.gmail.com
Whole thread Raw
In response to Re: Shave a few instructions from child-process startup sequence  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Shave a few instructions from child-process startup sequence  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Wed, Nov 20, 2013 at 10:21 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
On 11/5/13, 2:47 AM, Gurjeet Singh wrote:
> On Mon, Nov 4, 2013 at 12:20 AM, Tom Lane <tgl@sss.pgh.pa.us
> <mailto:tgl@sss.pgh.pa.us>> wrote:
>
>     But we're not buying much.  A few instructions during postmaster
>     shutdown
>     is entirely negligible.
>
>
> The patch is for ClosePostmasterPorts(), which is called from every
> child process startup sequence (as $subject also implies), not in
> postmaster shutdown. I hope that adds some weight to the argument.

If there is a concern about future maintenance, you could add assertions
(in appropriate compile mode) that the rest of the array is indeed
PGINVALID_SOCKET.  I think that could be a win for both performance and
maintainability.

Makes sense! Does the attached patch look like what you expected? I also added a comment to explain the expectation.

Thanks and best regards,
Attachment

pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: [GENERAL] pg_upgrade ?deficiency
Next
From: Tom Lane
Date:
Subject: Re: Building on S390