Re: Shave a few instructions from child-process startup sequence

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gurjeet Singh <gurjeet(at)singh(dot)im>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Shave a few instructions from child-process startup sequence
Date: 2013-11-04 04:21:26
Message-ID: CAA4eK1J3jvWvVrHgNhBdL8OrGsgoecL3k78RPdmc4TfqYi18aA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 1, 2013 at 9:50 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
>> On Thu, Oct 31, 2013 at 2:41 AM, Gurjeet Singh <gurjeet(at)singh(dot)im> wrote:
>>> Just a small patch; hopefully useful.
>
>> This is valid saving as we are filling array ListenSocket[] in
>> StreamServerPort() serially, so during ClosePostmasterPorts() once if
>> it encountered PGINVALID_SOCKET, it is valid to break the loop.
>> Although savings are small considering this doesn't occur in any
>> performance path, still I think this is right thing to do in code.
>
>> It is better to register this patch in CF app list, unless someone
>> feels this is not right.
>
> I think this is adding fragility for absolutely no meaningful savings.
> The existing code does not depend on the assumption that the array
> is filled consecutively and no entries are closed early.

As I could see, it appears to me that code in ServerLoop and
initMasks is already dependent on it, if any socket is closed out of
order, it can break the logic in these API's. Do me and Gurjeet are
missing some point here?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-11-04 05:20:25 Re: Shave a few instructions from child-process startup sequence
Previous Message Stephen Frost 2013-11-04 03:26:04 postgres_fdw & async queries